This is my Dockerfile for distroless image similar to this example
FROM python:3.9-slim AS build-venvRUN python3 -m venv /venv # other installation steps go hereRUN /venv/bin/pip install --upgrade pip setuptools wheel# installing from requirements.txt etc.# Copy the virtualenv into a distroless imageFROM gcr.io/distroless/python3-debian11COPY --from=build-venv /venv /venvENTRYPOINT ["/venv/bin/python3"]
I'm trying to just get into Python shell (with all the dependencies installed), but docker run -it my-distroless
gives me this error
docker: Error response from daemon: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: exec: "/venv/bin/python3": stat /venv/bin/python3: no such file or directory: unknown.
But when replacing base image with debian:11-slim
everything works as expected.
FROM debian:11-slim AS buildRUN apt-get update && \ apt-get install --no-install-suggests --no-install-recommends --yes python3-venv gcc libpython3-dev && \ python3 -m venv /venv# the rest is the same
Are there only "compatible" base images for distroless that I should use for my builds or what is the possible reason?