- Notifications
You must be signed in to change notification settings - Fork1
A minimal systemd enabled Debian 12 image
License
trfore/docker-debian12-systemd
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
A minimal systemd enabled debian12 Docker image for testing Ansible roles with Molecule.
NOTE: This image does NOT contain Ansible tooling, e.g.ansible-core
oryamllint
. Thus, the use case is as targethost for Ansible controllers or within the Moleculecreate
/converge
/test
cycle.
docker pull trfore/docker-debian12-systemd
This image is built on Docker Hub automatically any time the upstream OS image is rebuilt, and any time a commit is madeor merged to themain
branch. But if you need to build the image on your own locally, do the following:
- Installdocker
- Clone the repo,
git clone https://github.com/trfore/docker-debian12-systemd.git
cd
into the directory- Run
docker build --tag trfore/docker-debian12-systemd .
Add the following code to your molecule scenario file, e.g.
molecule/default/molecule.yml
.platforms: -name:instanceimage:trfore/docker-debian12-systemd:latesttmpfs: -/run -/tmpvolumes: -/sys/fs/cgroup:/sys/fs/cgroup:rwcgroupns_mode:hostprivileged:truepre_build_image:true
Installdocker
Build an image locally (see above) or pull from Docker Hub:
docker pull trfore/docker-debian12-systemd:latest
On Docker with Cgroup V1 (e.g. Ubuntu 20.04), run a container from the image:
docker run -d -it --name debian12-systemd --privileged --cgroupns=host --tmpfs=/run --tmpfs=/tmp --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro trfore/docker-debian12-systemd:latest
On Docker with Cgroup V2 (e.g. Ubuntu 22.04), run a container from the image:
docker run -d -it --name debian12-systemd --privileged --cgroupns=host --tmpfs=/run --tmpfs=/tmp --volume=/sys/fs/cgroup:/sys/fs/cgroup:rw trfore/docker-debian12-systemd:latest
Use it, example:
dockerexec -it debian12-systemd /bin/bash
Podman defaults to running containers in systemd mode,
--systemd=true
, and will mount the required tmpfs and cgroupfilesystem. SeePodman Docs: Commandsrun --systemd
for details.podman run -d -it --name debian12-systemd docker.io/trfore/docker-debian12-systemd:latest
Taylor Fore (https://github.com/trfore)
Inspired by Jeff Geerling's (@geerlingguy), CentOS 8, Debian 10/11, and Ubuntu 20/22docker images for ansible,geerlingguy/docker-*-ansible.
- https://molecule.readthedocs.io/en/stable/index.html
- https://molecule.readthedocs.io/en/stable/examples.html#systemd-container
- https://developers.redhat.com/blog/2016/09/13/running-systemd-in-a-non-privileged-container
- github runner - ubuntu 20.04 preinstalled software
- github runner - ubuntu 22.04 preinstalled software
About
A minimal systemd enabled Debian 12 image