Archlinux Docker container for Ansible playbook and role testing.
This repository is inpired by geerlingguy ansible docker images
latest
: Latest stable version of Ansible, with Python 3.x
This image is built on Docker Hub automatically any time the upstream OS container is rebuilt, and any time a commit is made or merged to the main
branch. But if you need to build the image on your own locally, do the following:
- Install Docker.
cd
into this directory.- Run
docker build -t arch-ansible .
- Install Docker.
- Pull this image from Docker Hub:
docker pull h33n0k/docker-arch-ansible:latest
(or use the image you built earlier, e.g.arch-ansible
). - Run a container from the image
docker run \
--detach \
--privileged \
--volume=/sys/fs/cgroup:/sys/fs/cgroup:rw \
--cgroupns=host \
h33n0k/docker-arch-ansible:latest
- Use Ansible inside the container:
docker exec --tty \
[container_id] \
env TERM=xterm \
ansible --version
- Use Shell inside the container:
docker exec -it \
[container_id] \
env TERM=xterm \
/bin/bash
In your molecule.yml
, add the following platform:
- name: ArchLinux
image: h33n0k/docker-arch-ansible:latest
pre_build_image: true
command: /lib/systemd/systemd
environment:
container: docker
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:rw
- /run
- /run/lock
privileged: true
cgroupns_mode: host
ansible_variables:
ansible_python_interpreter: /usr/bin/python3.9
I use this image for testing in an isolated environment—not for production—and the settings and configuration used may not be suitable for a secure and performant production environment. Use on production servers/in the wild at your own risk!
Created in 2025 by h33n0k
This project is licensed under the MIT License.