docker-library / python

Docker Official Image packaging for Python
https://www.python.org/
MIT License
2.5k stars 1.04k forks source link

Problem pulling any arm64v8/python images #933

Closed waynePovey closed 1 week ago

waynePovey commented 1 week ago

Hi,

As of this morning (earliest known failure was about 09:00UTC but working fine yesterday), our Github docker build has been unable to pull the arm64v8/python:3.10-bullseye image, though on further investigation I am unable to pull any of the arm64v8/python images even on my local machine. I receive the following error:

Using default tag: latest
latest: Pulling arm64v8/python
no matching manifest for linux/amd64 in the manifest list entries

Any assistance you could provide would be greatly appreciated. Thanks.

LaurentGoderre commented 1 week ago

You should be using the multi-arch index and specify the arch via the --platform arg.

docker pull --platform linux/arm64/v8 python

or

docker run --platform linux/arm64/v8 python
waynePovey commented 1 week ago

Hi Laurent,

Can you explain how that would translate to pulling it using the FROM command in Dockerfile?

This is how I'm using it in my Dockerfile FROM arm64v8/python:3.10-bullseye

and according to the docs this is correct approach and was working fine until this morning https://hub.docker.com/r/arm64v8/python

Do you know what's changed?

yosifkit commented 1 week ago

We've been slowly moving Official Images to a new build process and moved python yesterday, so now the arch-specific namespaces are an image index because they include attached provenance/sbom metedata.

https://explore.ggcr.dev/?image=arm64v8%2Fpython%3A3.10-bullseye

So in a Dockerfile, that would be the following (or without --platform ... and build on an arm64v8 host):

FROM --platform=linux/arm64/v8 arm64v8/python:3.10-bullseye
waynePovey commented 1 week ago

OK, that's great. Thanks, both of you for the quick responses. I'll make that change tomorrow.

Prasad1008 commented 1 week ago

after changes the base image docker build,

FROM --platform=linux/arm64/v8 arm64v8/python:3-alpine
WORKDIR /usr/src/app
COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
CMD [ "python", "./CMS_Script.py" ]

following is the issue,

ERROR: failed to solve: process "/bin/sh -c pip install --no-cache-dir -r requirements.txt" did not complete successfully: exit code: 1
LaurentGoderre commented 1 week ago

@Prasad1008 is it possible that some of the dependencies you are trying to get need to be built?