-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Description
I have an M4 macbook air and am trying to use python:3.11-slim as my base here is my Dockerfile below
FROM python:3.11-slim
WORKDIR /app
# Install dependencies with uv (parallel downloads, uses pre-built wheels)
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy application
COPY app.py .
# Expose the sidecar port
EXPOSE 7778
# Bind to 0.0.0.0 so the server is reachable from outside the container
ENV FLASK_APP=app.py
CMD ["flask", "run", "--host=0.0.0.0", "--port=7778"]
running this fails at pip install
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 448B 0.0s
=> [internal] load metadata for docker.io/library/python:3.11-slim 0.5s
=> [auth] library/python:pull token for registry-1.docker.io 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [1/5] FROM docker.io/library/python:3.11-slim@sha256:d6e4d224f70f9e0172a06a3a2eba2f768eb146 0.0s
=> => resolve docker.io/library/python:3.11-slim@sha256:d6e4d224f70f9e0172a06a3a2eba2f768eb146 0.0s
=> [internal] load build context 0.0s
=> => transferring context: 63B 0.0s
=> CACHED [2/5] WORKDIR /app 0.0s
=> CACHED [3/5] COPY requirements.txt . 0.0s
=> ERROR [4/5] RUN pip install --no-cache-dir -r requirements.txt 0.1s
------
> [4/5] RUN pip install --no-cache-dir -r requirements.txt:
0.106 exec /bin/sh: exec format error
------
Dockerfile:8
--------------------
6 | # Install dependencies with uv (parallel downloads, uses pre-built wheels)
7 | COPY requirements.txt .
8 | >>> RUN pip install --no-cache-dir -r requirements.txt
9 |
10 | # Copy application
--------------------
ERROR: failed to build: failed to solve: process "/bin/sh -c pip install --no-cache-dir -r requirements.txt" did not complete successfully: exit code: 255
if I swap the FROM to
FROM --platform=linux/amd64 python:3.11-slim then it builds (but with emulation which is not ideal)
System info:
Macbook air M4, 2025, macOS Sequoia 15.3
Thank you in advance if anyone has a fix for this!!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels