A Shell Container to tests your Ansible role using Molecule.
Clone the repository and build the container (needs docker installed)
git clone [email protected]:buluma/docker-molecule-shell.git
cd docker-molecule-shell/
docker build -t docker-molecule-shell:local -f Dockerfile .
docker pull ghcr.io/buluma/docker-molecule-shell:latest
Start the container
docker run -d --name docker-molecule-shell \
--cap-add SYS_ADMIN \
--privileged \
--cgroupns=host \
-v /sys/fs/cgroup:/sys/fs/cgroup:rw \
-v /var/run/docker.sock:/var/run/docker.sock \
-v /PATH/TO/REPOSITORY/:/workspace \
ghcr.io/buluma/docker-molecule-shell:latest /usr/sbin/init
docker exec -it docker-molecule-shell /bin/bash