>>> container = client.containers.get('fa58eebd31bfe19add69043e3be368fed5a57d01965887d8d3b507a0ce42d89a')
>>> container.image.tags
Traceback (most recent call last):
File "/home/circleci/.local/lib/python3.11/site-packages/docker/api/client.py", line 268, in _raise_for_status
response.raise_for_status()
File "/home/circleci/.local/lib/python3.11/site-packages/requests/models.py", line 1021, 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.40/images/latest/json
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/circleci/.local/lib/python3.11/site-packages/docker/models/containers.py", line 40, in image
return self.client.images.get(image_id.split(':')[1])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/circleci/.local/lib/python3.11/site-packages/docker/models/images.py", line 335, in get
return self.prepare_model(self.client.api.inspect_image(name))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/circleci/.local/lib/python3.11/site-packages/docker/utils/decorators.py", line 19, in wrapped
return f(self, resource_id, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/circleci/.local/lib/python3.11/site-packages/docker/api/image.py", line 251, in inspect_image
return self._result(
^^^^^^^^^^^^^
File "/home/circleci/.local/lib/python3.11/site-packages/docker/api/client.py", line 274, in _result
self._raise_for_status(response)
File "/home/circleci/.local/lib/python3.11/site-packages/docker/api/client.py", line 270, in _raise_for_status
raise create_api_error_from_http_exception(e) from e
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/circleci/.local/lib/python3.11/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.40/images/latest/json: Not Found ("failed to find image latest: latest: No such image")
See podman-container-tools/podman#18930 for how I found this.
The following code is erroneous:
I believe it should be:
Used against podman, the current code results in the following: