Skip to content

[BUG] run doesn't pull image automatically #594

@sekyHC

Description

@sekyHC

client.containers.run and create are behaving differently.

example code:

self.client.containers.run(image="docker.io/alpine/openssl:3.5.3", name="registry_cert_gen",
                            remove=True,
                            command=command)

self.client.containers.create(image="docker.io/alpine/openssl:3.5.3", name="registry_cert_gen",
                            command=command)

When run is used, I get the following:

    output = self.client.containers.run(image="docker.io/alpine/openssl:3.5.3", name="registry_cert_gen",
                                volumes=volumes,
    ...<2 lines>...
                                user="root",
                                command=command)
  File "/home/pixii/.local/lib/python3.13/site-packages/podman/domain/containers_run.py", line 74, in run
    container = self.create(image=image, command=command, **kwargs)
  File "/home/pixii/.local/lib/python3.13/site-packages/podman/domain/containers_create.py", line 382, in create
    response.raise_for_status(not_found=ImageNotFound)
    ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pixii/.local/lib/python3.13/site-packages/podman/api/client.py", line 82, in raise_for_status
    raise APIError(cause, response=self._response, explanation=message)
podman.errors.exceptions.APIError: 500 Server Error: Internal Server Error (docker.io/alpine/openssl:3.5.3: image not known)

When create is used, the image is pulled automatically without any issues.

Podman 4.3.1
podman 5.6.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions