Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

podman-docker: docker_image fails silently without archiving despite archive_path being specified #291

Closed
mohd-akram opened this issue Feb 3, 2022 · 2 comments · Fixed by #292
Labels
docker-plain plain Docker (no swarm, no compose, no stack)

Comments

@mohd-akram
Copy link

SUMMARY

docker_image fails silently without archiving despite archive_path being specified (happens when using docker via podman-docker).

ISSUE TYPE
  • Bug Report
COMPONENT NAME

docker_image

ANSIBLE VERSION
ansible [core 2.12.1]
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/home/mohamed/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/mohamed/.local/lib/python3.10/site-packages/ansible
  ansible collection location = /home/mohamed/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/mohamed/.local/bin/ansible
  python version = 3.10.2 (main, Jan 17 2022, 00:00:00) [GCC 11.2.1 20211203 (Red Hat 11.2.1-7)]
  jinja version = 3.0.1
  libyaml = True
COLLECTION VERSION
Collection       Version
---------------- -------
community.docker 2.1.1
CONFIGURATION
OS / ENVIRONMENT

Fedora 35

STEPS TO REPRODUCE
sudo ansible -m docker_image -a 'name=redis source=pull archive_path=redis.tar' -c local localhost
EXPECTED RESULTS

"actions" should have "Archived image ..."

ACTUAL RESULTS
localhost | CHANGED => {
    "actions": [
        "Pulled image redis:latest"
    ],
    "changed": true,
    "image": null
}
@felixfontein felixfontein changed the title docker_image fails silently without archiving despite archive_path being specified podman-docker: docker_image fails silently without archiving despite archive_path being specified Feb 4, 2022
@felixfontein
Copy link
Collaborator

I guess there is some incompatibility between how podman-docker and Docker work. As you can see in "image": null returned by the module, the module was not able to find the pulled image. It uses the same image name and tag it uses for pulling.

A wild guess is that podman-docker allows to pull images by Docker short name, but does not allow to find them by Docker short name. You might want to try using docker.io/library/redis instead of redis, which is the full name of the image.

@felixfontein
Copy link
Collaborator

I created a fix that might solve this: #292. Would be great if you could try it out! (Then you can keep using the short name redis.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docker-plain plain Docker (no swarm, no compose, no stack)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants