Collection of Dockerfiles to build Container Images that include necessary packages to test Ansible Roles with Molecule.
- Container
- How to run systemd Container with Docker
- How to use systemd Container with Molecule
- Source
- Contribute
- License
Container based on sles12sp5:latest that includes Python2 to allow testing Ansible Roles with Molecule.
Container based on sles12sp5:latest that includes Python2 and systemd to allow testing Ansible Roles with Molecule.
Container based on ubi7/ubi-init:latest:latest that includes Python2 and systemd to allow testing Ansible Roles with Molecule.
docker run \
--tmpfs /run --tmpfs /tmp \
--volume /sys/fs/cgroup:/sys/fs/cgroup:ro \
--volume /dev/shm --tmpfs /dev/shm:rw,nosuid,nodev,exec,size=64M \
--detach --rm \
--name <containername> \
<image>
The /dev/shm
line is nececessary to meet requirements of the included sapconf
package in the sles12sp5-python2-systemd
container.
Can be omitted when using other container or if sapconf
isn't required / can be ignored.
Further details why the other tmpfs and volume statements are necessary:
- https://developers.redhat.com/blog/2016/09/13/running-systemd-in-a-non-privileged-container#the_quest (Archive: [1], [2])
- https://blog.swwomm.com/2020/10/testing-systemd-services-on-arch-fedora.html (Archive: [1], [2])
- moby/moby#6758 (comment) (Archive: [1], [2])
platforms:
- name: <containername>
image: <image>
pre_build_image: true
tmpfs:
- /run
- /tmp
- /dev/shm:rw,nosuid,nodev,exec,size=64M
volumes:
- "/sys/fs/cgroup:/sys/fs/cgroup:ro"
- "/dev/shm"
See How to run systemd Container with Docker section above for information about /dev/shm
.
The primary location is: https://git.sr.ht/~wombelix/ansible-molecule-container
Mirrors of the repository are available on Codeberg, Gitlab and Github.
Don't hesitate to provide Feedback, open an Issue or create an Pull / Merge Request.
Just pick the workflow or platform you prefer and are most comfortable with.
Feedback, Bug Reports or Patches via Email are also always welcome.
Unless otherwise stated: GNU General Public License v3.0 or later
All files contain license information either as header comment
or corresponding .license
file.
REUSE from the FSFE implemented to verify license and copyright compliance.