ansible
Ansible (2.21, 2.20, 2.19 & older) inside Docker: Alpine, Ubuntu, Rocky, Debian
5M+
Ansible inside Docker for consistent running of ansible inside your local machine or CI/CD system. You can view CHANGELOG to understand what changes have happened to this recently.
These are the latest Ansible Core versions running within the containers:
Dockerfile linksThere are a number of immutable images that are also being collected. To find a specific version of Ansible, look within the Docker Hub Tags. Each of the containers follow a similar pattern: Ansible-version-Base OS version.
This includes:
ansible-core (https://pypi.org/project/ansible-core/)ansible (https://pypi.org/project/ansible/)ansible-lint (https://pypi.org/project/ansible-lint/)ARM (ARM64/ARMv7) releases are available for all container images.
| Base Image (↓) \ Ansible Version (→) | Dockerfile | 2.21 | 2.20 | 2.19 | 2.18 | 2.17 | 2.16 |
|---|---|---|---|---|---|---|---|
| Latest | Dockerfile | latest | |||||
| Alpine | Dockerfile | alpine | |||||
| Ubuntu | Dockerfile | ubuntu | |||||
| Alpine 3.19 | Dockerfile | 2.19-alpine-3.19 | 2.18-alpine-3.19 | 2.17-alpine-3.19 | 2.16-alpine-3.19 | ||
| Alpine 3.20 | Dockerfile | 2.21-alpine-3.20 | 2.20-alpine-3.20 | 2.19-alpine-3.20 | 2.18-alpine-3.20 | 2.17-alpine-3.20 | 2.16-alpine-3.20 |
| Alpine 3.21 | Dockerfile | 2.21-alpine-3.21 | 2.20-alpine-3.21 | 2.19-alpine-3.21 | 2.18-alpine-3.21 | 2.17-alpine-3.21 | 2.16-alpine-3.21 |
| Alpine 3.22 | Dockerfile | 2.21-alpine-3.22 | 2.20-alpine-3.22 | 2.19-alpine-3.22 | 2.18-alpine-3.22 | 2.17-alpine-3.22 | 2.16-alpine-3.22 |
| Bookworm (Debian 12) | Dockerfile | 2.19-debian-bookworm | 2.18-debian-bookworm | 2.17-debian-bookworm | 2.16-debian-bookworm | ||
| Bookworm Slim (Debian 12) | Dockerfile | 2.19-debian-bookworm-slim | 2.18-debian-bookworm-slim | 2.17-debian-bookworm-slim | 2.16-debian-bookworm-slim | ||
| Trixie (Debian 13) | Dockerfile | 2.21-debian-trixie | 2.20-debian-trixie | 2.19-debian-trixie | 2.18-debian-trixie | 2.17-debian-trixie | |
| Trixie Slim (Debian 13) | Dockerfile | 2.21-debian-trixie-slim | 2.20-debian-trixie-slim | 2.19-debian-trixie-slim | 2.18-debian-trixie-slim | 2.17-debian-trixie-slim | |
| Rocky Linux 10 | Dockerfile | 2.21-rockylinux-10 | 2.20-rockylinux-10 | 2.19-rockylinux-10 | 2.18-rockylinux-10 | 2.17-rockylinux-10 | 2.16-rockylinux-10 |
| Ubuntu 22.04 | Dockerfile | 2.17-ubuntu-22.04 | 2.16-ubuntu-22.04 | ||||
| Ubuntu 24.04 | Dockerfile | 2.21-ubuntu-24.04 | 2.20-ubuntu-24.04 | 2.19-ubuntu-24.04 | 2.18-ubuntu-24.04 | 2.17-ubuntu-24.04 | 2.16-ubuntu-24.04 |
| Ubuntu 26.04 | Dockerfile | 2.21-ubuntu-26.04 | 2.20-ubuntu-26.04 |
OS:
Ansible-core:
Various older versions are available in the older-releases documentation.
Note: You will likely need to mount required directories into your container to make it run (or build on top of what is here).
docker run --rm -it willhallonline/ansible:latest /bin/sh
docker run --rm -it -v $(pwd):/ansible -v ~/.ssh/id_rsa:/root/id_rsa willhallonline/ansible:latest /bin/sh
docker run --rm -it -v $(pwd):/ansible -v ~/.ssh/id_rsa:/root/id_rsa willhallonline/ansible:latest ansible-playbook playbook.yml
You can put these inside your dotfiles (~/.bashrc or ~/.zshrc to make handy aliases).
alias docker-ansible-cli='docker run --rm -it -v $(pwd):/ansible -v ~/.ssh/id_rsa:/root/.ssh/id_rsa --workdir=/ansible willhallonline/ansible:latest /bin/sh'
alias docker-ansible-cmd='docker run --rm -it -v $(pwd):/ansible -v ~/.ssh/id_rsa:/root/.ssh/id_rsa --workdir=/ansible willhallonline/ansible:latest '
use with:
docker-ansible-cli
docker-ansible-cmd ansible-playbook playbook.yml
To accelerate using Mitogen look into Using Mitogen.
Content type
Image
Digest
sha256:a73a7bb1a…
Size
194.7 MB
Last updated
3 days ago
docker pull willhallonline/ansible:2.20-rockylinux-10