Docker image with Ansible & ansible-lint.
833
Ansible images for fun and profit.
Ships with:
Base image: python:3.11-slim (Debian Bookworm).
The image ships only with ansible-core (no bundled collections). Install
the collections you need at runtime, typically via your project's
requirements.yml:
ansible-galaxy collection install -r requirements.yml
This keeps the image small and lets each consumer pin its own collection versions.
A -molecule variant is published alongside the standard image, intended for
testing Ansible roles with the Molecule + Docker driver.
Tags: latest-molecule, head-molecule, <gittag>-molecule.
On top of the base image, it adds:
docker-cli (CLI only — no daemon, talks to a mounted host socket), rsyncmolecule, molecule-plugins[docker], docker/usr/share/ansible/collections):
community.docker, ansible.posix, community.generalThe ansible user is added to the docker group at build time. To talk to a
Docker socket mounted from the host, you typically also need to align the
group at runtime:
docker run --rm \
-v /var/run/docker.sock:/var/run/docker.sock \
--group-add $(stat -c '%g' /var/run/docker.sock) \
-v $(pwd):/src \
letompouce/ansible:latest-molecule \
molecule test
Default versions: ANSIBLE_CORE_VERSION=2.16.0, ANSIBLELINT_VERSION=24.10.0.
Override versions:
docker build \
--build-arg ANSIBLE_CORE_VERSION=2.16.0 \
--build-arg ANSIBLELINT_VERSION=24.10.0 \
-t letompouce/ansible:2.16 \
.
Basic invocation:
docker run --rm letompouce/ansible ansible --version
WORKDIR is /src/.
Mount a local playbook:
docker run --rm \
-v $(pwd):/src \
letompouce/ansible \
ansible-playbook --syntax-check playbook/site.yml
Use the host's timezone:
docker run --rm \
-v /etc/localtime:/etc/localtime:ro \
letompouce/ansible \
ansible --version
Use an arbitrary timezone:
docker run --rm \
-e 'TZ=Europe/Paris' \
letompouce/ansible \
ansible --version
Content type
Image
Digest
sha256:33902effc…
Size
111.7 MB
Last updated
5 months ago
docker pull letompouce/ansible