{"id":15602317,"url":"https://github.com/trfore/docker-ubuntu2204-systemd","last_synced_at":"2025-04-12T14:34:22.366Z","repository":{"id":158400929,"uuid":"624974461","full_name":"trfore/docker-ubuntu2204-systemd","owner":"trfore","description":"A minimal systemd enabled Ubuntu 22.04 image","archived":false,"fork":false,"pushed_at":"2025-04-09T14:35:03.000Z","size":59,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-09T15:42:50.885Z","etag":null,"topics":["ansible-molecule","docker-image","systemd","ubuntu"],"latest_commit_sha":null,"homepage":"https://hub.docker.com/r/trfore/docker-ubuntu2204-systemd","language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/trfore.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-04-07T18:24:05.000Z","updated_at":"2025-04-09T14:35:06.000Z","dependencies_parsed_at":"2023-12-20T19:28:56.205Z","dependency_job_id":"f5ff7856-b80e-4396-a71b-d65b8d199b9c","html_url":"https://github.com/trfore/docker-ubuntu2204-systemd","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trfore%2Fdocker-ubuntu2204-systemd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trfore%2Fdocker-ubuntu2204-systemd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trfore%2Fdocker-ubuntu2204-systemd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trfore%2Fdocker-ubuntu2204-systemd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/trfore","download_url":"https://codeload.github.com/trfore/docker-ubuntu2204-systemd/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248581382,"owners_count":21128161,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ansible-molecule","docker-image","systemd","ubuntu"],"created_at":"2024-10-03T02:41:06.047Z","updated_at":"2025-04-12T14:34:22.343Z","avatar_url":"https://github.com/trfore.png","language":"Dockerfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# docker-ubuntu2204-systemd\n\n[![CI](https://github.com/trfore/docker-ubuntu2204-systemd/actions/workflows/ci.yml/badge.svg)](https://github.com/trfore/docker-ubuntu2204-systemd/actions/workflows/ci.yml)\n[![CD](https://github.com/trfore/docker-ubuntu2204-systemd/actions/workflows/cd.yml/badge.svg)](https://github.com/trfore/docker-ubuntu2204-systemd/actions/workflows/cd.yml)\n\nA minimal systemd enabled Ubuntu 22.04 Docker image for testing Ansible roles with Molecule.\n\nNOTE: This image does NOT contain Ansible tooling, e.g. `ansible-core` or `yamllint`. Thus, the use case is as target\nhost for Ansible controllers or within the Molecule `create`/`converge`/`test` cycle.\n\n## Docker Pull Command\n\n```sh\ndocker pull trfore/docker-ubuntu2204-systemd\n```\n\n## How to Build\n\nThis image is built on Docker Hub automatically any time the upstream OS image is rebuilt, and any time a commit is made\nor merged to the `main` branch. But if you need to build the image on your own locally, do the following:\n\n1. Install [docker]\n2. Clone the repo, `git clone https://github.com/trfore/docker-ubuntu2204-systemd.git`\n3. `cd` into the directory\n4. Run `docker build --tag trfore/docker-ubuntu2204-systemd .`\n\n## How to Use\n\n### Within Molecule Scenario\n\n- Add the following code to your molecule scenario file, e.g. `molecule/default/molecule.yml`.\n\n  ```yaml\n  platforms:\n    - name: instance\n      image: trfore/docker-${MOLECULE_DISTRO:-debian10}-systemd:latest\n      tmpfs:\n        - /run\n        - /tmp\n      volumes:\n        - /sys/fs/cgroup:/sys/fs/cgroup:rw\n      cgroupns_mode: host\n      privileged: true\n      pre_build_image: true\n  ```\n\n### Interactively Using Docker\n\n- Install [docker]\n- Build an image locally (see above) or pull from Docker Hub: `docker pull trfore/docker-ubuntu2204-systemd:latest`\n- **On Docker with Cgroup V1 (e.g. Ubuntu 20.04)**, run a container from the image:\n\n  ```sh\n  docker run -d -it --name ubuntu2204-systemd --privileged --cgroupns=host --tmpfs=/run --tmpfs=/tmp --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro trfore/docker-ubuntu2204-systemd:latest\n  ```\n\n- **On Docker with Cgroup V2 (e.g. Ubuntu 22.04)**, run a container from the image:\n\n  ```sh\n  docker run -d -it --name ubuntu2204-systemd --privileged --cgroupns=host --tmpfs=/run --tmpfs=/tmp --volume=/sys/fs/cgroup:/sys/fs/cgroup:rw trfore/docker-ubuntu2204-systemd:latest\n  ```\n\n- Use it, ex:\n\n  ```sh\n  docker exec -it ubuntu2204-systemd /bin/bash\n  ```\n\n### Using Podman\n\n- Podman defaults to running containers in systemd mode, `--systemd=true`, and will mount the required tmpfs and cgroup\n  filesystem. See [Podman Docs: Commands `run --systemd`] for details.\n\n  ```sh\n  podman run -d -it --name ubuntu2204-systemd docker.io/trfore/docker-ubuntu2204-systemd:latest\n  ```\n\n## Additional Images\n\n| Base OS                          | Github                      | Docker Hub                         |\n| -------------------------------- | --------------------------- | ---------------------------------- |\n| [CentOS Stream 8][centos-stream] | [docker-centos8-systemd]    | [trfore/docker-centos8-systemd]    |\n| [CentOS Stream 9][centos-stream] | [docker-centos9-systemd]    | [trfore/docker-centos9-systemd]    |\n| [Debian 10][debian]              | [docker-debian10-systemd]   | [trfore/docker-debian10-systemd]   |\n| [Debian 11][debian]              | [docker-debian11-systemd]   | [trfore/docker-debian11-systemd]   |\n| [Debian 12][debian]              | [docker-debian12-systemd]   | [trfore/docker-debian12-systemd]   |\n| [Ubuntu 20.04][ubuntu]           | [docker-ubuntu2004-systemd] | [trfore/docker-ubuntu2004-systemd] |\n| [Ubuntu 22.04][ubuntu]           | [docker-ubuntu2204-systemd] | [trfore/docker-ubuntu2204-systemd] |\n| [Ubuntu 24.04][ubuntu]           | [docker-ubuntu2404-systemd] | [trfore/docker-ubuntu2404-systemd] |\n\n## Maintainers\n\nTaylor Fore (\u003chttps://github.com/trfore\u003e)\n\n## Acknowledgements\n\nInspired by Jeff Geerling's ([@geerlingguy](https://github.com/geerlingguy)), CentOS 8, Debian 10/11, and Ubuntu 20/22\ndocker images for ansible, [geerlingguy/docker-\\*-ansible](https://github.com/geerlingguy?tab=repositories\u0026q=docker-ansible).\n\n## References\n\n- \u003chttps://molecule.readthedocs.io/en/stable/index.html\u003e\n- \u003chttps://molecule.readthedocs.io/en/stable/examples.html#systemd-container\u003e\n- \u003chttps://developers.redhat.com/blog/2016/09/13/running-systemd-in-a-non-privileged-container\u003e\n- [github runner - ubuntu 20.04] preinstalled software\n- [github runner - ubuntu 22.04] preinstalled software\n\n[centos-stream]: https://quay.io/repository/centos/centos?tab=tags\n[debian]: https://hub.docker.com/_/debian/\n[docker]: https://docs.docker.com/engine/installation/\n[ubuntu]: https://hub.docker.com/_/ubuntu/\n[docker-centos8-systemd]: https://github.com/trfore/docker-centos8-systemd/blob/main/Dockerfile\n[docker-centos9-systemd]: https://github.com/trfore/docker-centos9-systemd/blob/main/Dockerfile\n[docker-debian10-systemd]: https://github.com/trfore/docker-debian10-systemd/blob/main/Dockerfile\n[docker-debian11-systemd]: https://github.com/trfore/docker-debian11-systemd/blob/main/Dockerfile\n[docker-debian12-systemd]: https://github.com/trfore/docker-debian12-systemd/blob/main/Dockerfile\n[docker-ubuntu2004-systemd]: https://github.com/trfore/docker-ubuntu2004-systemd/blob/main/Dockerfile\n[docker-ubuntu2204-systemd]: https://github.com/trfore/docker-ubuntu2204-systemd/blob/main/Dockerfile\n[docker-ubuntu2404-systemd]: https://github.com/trfore/docker-ubuntu2404-systemd/blob/main/Dockerfile\n[trfore/docker-centos8-systemd]: https://hub.docker.com/r/trfore/docker-centos8-systemd\n[trfore/docker-centos9-systemd]: https://hub.docker.com/r/trfore/docker-centos9-systemd\n[trfore/docker-debian10-systemd]: https://hub.docker.com/r/trfore/docker-debian10-systemd\n[trfore/docker-debian11-systemd]: https://hub.docker.com/r/trfore/docker-debian11-systemd\n[trfore/docker-debian12-systemd]: https://hub.docker.com/r/trfore/docker-debian12-systemd\n[trfore/docker-ubuntu2004-systemd]: https://hub.docker.com/r/trfore/docker-ubuntu2004-systemd\n[trfore/docker-ubuntu2204-systemd]: https://hub.docker.com/r/trfore/docker-ubuntu2204-systemd\n[trfore/docker-ubuntu2404-systemd]: https://hub.docker.com/r/trfore/docker-ubuntu2404-systemd\n[github runner - ubuntu 20.04]: https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2004-Readme.md\n[github runner - ubuntu 22.04]: https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2204-Readme.md\n[Podman Docs: Commands `run --systemd`]: https://docs.podman.io/en/latest/markdown/podman-run.1.html#systemd-true-false-always\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrfore%2Fdocker-ubuntu2204-systemd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftrfore%2Fdocker-ubuntu2204-systemd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrfore%2Fdocker-ubuntu2204-systemd/lists"}