Sign inSign up

makanu/docker-rocky9-systemd

By makanu

•Updated 11 months ago

Image
Integration & delivery
Developer tools
Operating systems
0

332

makanu/docker-rocky9-systemd repository overview

⁠docker-rocky9-systemd

CI CD

A minimal systemd enabled rocky9 Docker image for testing Ansible roles with Molecule.

NOTE: This image does NOT contain Ansible tooling, e.g. ansible-core or yamllint. Thus, the use case is as target host for Ansible controllers or within the Molecule create/converge/test cycle.

⁠Docker Pull Command

docker pull makanu/docker-rocky9-systemd

⁠How to Build

This image is built on Docker Hub automatically any time the upstream OS image 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:

  1. Install docker⁠

  2. Clone the repo

    git clone https://github.com/makanu/docker-rocky9-systemd.git
    
  3. cd into the directory

  4. Run

    docker build --tag makanu/docker-rocky9-systemd .
    

⁠How to Use

⁠Within Molecule Scenario
  • Add the following code to your molecule scenario file, e.g. molecule/default/molecule.yml.

    platforms:
      - name: ${MOLECULE_NAME:-instance}
        image: ${MOLECULE_IMAGE:-makanu/docker-rocky9-systemd}
        command: ${MOLECULE_COMMAND:-""}
        tmpfs:
          - /run
          - /tmp
        volumes:
          - /sys/fs/cgroup:/sys/fs/cgroup:rw
        cgroupns_mode: host
        privileged: true
        pre_build_image: true
    
⁠Interactively Using Docker
  • Install docker⁠

  • Build an image locally (see above) or pull from Docker Hub: docker pull makanu/docker-rocky9-systemd:latest

  • Run a container from the image:

    docker run -d -it --name rocky9-systemd --privileged --cgroupns=host --tmpfs=/run --tmpfs=/tmp --volume=/sys/fs/cgroup:/sys/fs/cgroup:rw makanu/docker-rocky9-systemd:latest
    
  • Use it, example:

    docker exec -it rocky9-systemd /bin/bash
    
⁠Using Podman
  • Podman defaults to running containers in systemd mode, --systemd=true, and will mount the required tmpfs and cgroup filesystem. See Podman Docs: Commands run --systemd⁠ for details.

    podman run -d -it --name rocky9-systemd docker.io/makanu/docker-rocky9-systemd:latest
    

⁠Additional Images

⁠Maintainers

MaKaNu (https://github.com/makanu⁠)

⁠Acknowledgements

Inspired by Jeff Geerling's (@geerlingguy⁠), CentOS 8, Debian 10/11, and Ubuntu 20/22 docker images for ansible, geerlingguy/docker-*-ansible⁠.

⁠References

Tag summary

Content type

Image

Digest

sha256:9a6959937…

Size

131.1 MB

Last updated

11 months ago

docker pull makanu/docker-rocky9-systemd