docker-py icon indicating copy to clipboard operation
docker-py copied to clipboard

Unable to find image

Open jonathan-boudreau-work opened this issue 1 year ago • 4 comments

Steps to reproduce

  • On macos (non-arm) with docker for mac
  • Pull down image with docker pull aghost7/nodejs-dev:noble
  • From python, run the following code client.images.get('aghost7/nodejs-dev:noble').

Expected behaviour

get returns the image model.

Actual behaviour

I get the following exception:

Traceback (most recent call last):
  File "/Users/jonathanboudreau/Library/Caches/pypoetry/virtualenvs/slipway-axL3wFL9-py3.12/lib/python3.12/site-packages/docker/api/client.py", line 275, in _raise_for_status
    response.raise_for_status()
  File "/Users/jonathanboudreau/Library/Caches/pypoetry/virtualenvs/slipway-axL3wFL9-py3.12/lib/python3.12/site-packages/requests/models.py", line 1024, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: http+docker://localhost/v1.41/images/aghost7/nodejs-dev:noble/json

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/jonathanboudreau/Library/Caches/pypoetry/virtualenvs/slipway-axL3wFL9-py3.12/lib/python3.12/site-packages/docker/models/images.py", line 333, in get
    return self.prepare_model(self.client.api.inspect_image(name))
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jonathanboudreau/Library/Caches/pypoetry/virtualenvs/slipway-axL3wFL9-py3.12/lib/python3.12/site-packages/docker/utils/decorators.py", line 19, in wrapped
    return f(self, resource_id, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jonathanboudreau/Library/Caches/pypoetry/virtualenvs/slipway-axL3wFL9-py3.12/lib/python3.12/site-packages/docker/api/image.py", line 251, in inspect_image
    return self._result(
           ^^^^^^^^^^^^^
  File "/Users/jonathanboudreau/Library/Caches/pypoetry/virtualenvs/slipway-axL3wFL9-py3.12/lib/python3.12/site-packages/docker/api/client.py", line 281, in _result
    self._raise_for_status(response)
  File "/Users/jonathanboudreau/Library/Caches/pypoetry/virtualenvs/slipway-axL3wFL9-py3.12/lib/python3.12/site-packages/docker/api/client.py", line 277, in _raise_for_status
    raise create_api_error_from_http_exception(e) from e
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jonathanboudreau/Library/Caches/pypoetry/virtualenvs/slipway-axL3wFL9-py3.12/lib/python3.12/site-packages/docker/errors.py", line 39, in create_api_error_from_http_exception
    raise cls(e, response=response, explanation=explanation) from e
docker.errors.ImageNotFound: 404 Client Error for http+docker://localhost/v1.41/images/aghost7/nodejs-dev:noble/json: Not Found ("failed to find image aghost7/nodejs-dev:noble: docker.io/aghost7/nodejs-dev:noble: No such image")

jonathan-boudreau-work avatar Nov 06 '24 20:11 jonathan-boudreau-work

I tried rebuilding the image on my local, and I still get the same error. I thought it might've been because I built it using podman but that doesn't seem to be the case.

jonathan-boudreau-work avatar Nov 07 '24 18:11 jonathan-boudreau-work

@jonathan-boudreau-work, can you guide me on how you are getting this error when you are trying to build the image, or are you encountering this error while running in a specific environment?

manas9853 avatar Dec 19 '24 10:12 manas9853

I'm not building the image or trying to run it. This is just when I use client.images.get(name) to get some metadata from it.

jonathan-boudreau-work avatar Dec 19 '24 16:12 jonathan-boudreau-work