I am trying to pull the ansible image, I search on hub.docker.com, I found the one, which was updated 4 years ago https://hub.docker.com/r/ansible/ansible.
When I was trying to pull that, its not working.
$ docker pull ansible/ansible
Using default tag: latest
Error response from daemon: manifest for ansible/ansible:latest not found: manifest unknown: manifest unknown
I also check, if there is any networking issue, but I am able to download the alpine
image.
$ docker image pull alpine
Using default tag: latest
latest: Pulling from library/alpine
59bf1c3509f3: Pull complete
Digest: sha256:21a3deaa0d32a8057914f36584b5288d2e5ecc984380bc0118285c70fa8c9300
Status: Downloaded newer image for alpine:latest
docker.io/library/alpine:latest
means it works :D .
I am also looking for ansible official image, but there is no official image?
CodePudding user response:
It takes less than 5 minutes to build your own from a base python image leaving you absolute and full control over the version of python you want to use, the optional python packages to install, the exact version of ansible to use, the optional collections to install...
Below an example Dockerfile
to install a base ansible in latest version in the latest available python version. Adapt to your own needs.
FROM python:latest
RUN pip install ansible
CMD bash
From the directory where your create that file run
docker build -t ansible:mytag .
Then enjoy
$ docker run -it --rm --name ansible_test_container ansible:mytag
root@a4ec5c718267:/# ansible --version
ansible [core 2.12.1]
config file = None
configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /usr/local/lib/python3.10/site-packages/ansible
ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections
executable location = /usr/local/bin/ansible
python version = 3.10.1 (main, Dec 8 2021, 03:30:49) [GCC 10.2.1 20210110]
jinja version = 3.0.3
libyaml = True
root@a4ec5c718267:/# exit
exit