Unable to find image
Open
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 7.2k
- Forks
- 1.7k
- Avg merge
- 13d 8h
- Merged PRs (30d)
- 2
Description
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")
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the ImageCollection.get path in docker/models/images.py and the inspect_image entry point in docker/api/image.py, using the reproduction steps with the pulled image. Compare the requested image name with the Docker Engine response and existing image tests. Done means the reported image can be retrieved after pulling it, or the behavior and supported image-name format are documented by a regression test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, python
- Domain
- backend-api-design
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100