diff --git a/.github/workflows/build-and-push.yml b/.github/workflows/build-and-push.yml index 7287696..293149d 100644 --- a/.github/workflows/build-and-push.yml +++ b/.github/workflows/build-and-push.yml @@ -18,7 +18,7 @@ jobs: include: - tag: 'amazonlinux-2023' dockerfile: 'amazonlinux/2023.Dockerfile' - platforms: 'linux/amd64, linux/arm64' + platforms: 'linux/amd64,linux/arm64' - tag: 'centos-7' dockerfile: 'centos/7.Dockerfile' @@ -36,6 +36,14 @@ jobs: dockerfile: 'debian/12.Dockerfile' platforms: 'linux/amd64,linux/arm64' + - tag: 'fedora-39' + dockerfile: 'debian/39.Dockerfile' + platforms: 'linux/amd64,linux/arm64' + + - tag: 'fedora-40' + dockerfile: 'debian/40.Dockerfile' + platforms: 'linux/amd64,linux/arm64' + - tag: 'rockylinux-8' dockerfile: 'rockylinux/8.Dockerfile' platforms: 'linux/amd64,linux/arm64' diff --git a/README.md b/README.md index d3cea2b..86fe8fe 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,11 @@ Debian: - `debian-11` (`linux/amd64`,`linux/arm64`) - `debian-12` (`linux/amd64`,`linux/arm64`) +Fedora: + +- `fedora-39` (`linux/amd64`,`linux/arm64`) +- `fedora-40` (`linux/amd64`,`linux/arm64`) + Rocky Linux: - `rockylinux-8` (`linux/amd64`,`linux/arm64`) @@ -31,6 +36,8 @@ Ubuntu: ## Usage +### With Molecule + ```yaml --- dependency: @@ -65,6 +72,28 @@ verifier: name: 'ansible' ``` +### Build and run + +- Build the image with `Ubuntu 22.04` + + ```bash + export DISTR='ubuntu' + export VERSION='22.04' + docker build -t docker-systemd:${DISTR}-${VERSION} -f ${DISTR}/${VERSION}.Dockerfile . + ``` + +- Run the container + + ```bash + docker run -d --name systemd-${DISTR}-${VERSION} --privileged -v /sys/fs/cgroup:/sys/fs/cgroup:rw --cgroupns=host docker-systemd:${DISTR}-${VERSION} + ``` + +- Enter to the container + + ```bash + docker exec -it systemd-${DISTR}-${VERSION} /bin/bash + ``` + ## License MIT diff --git a/fedora/39.Dockerfile b/fedora/39.Dockerfile new file mode 100644 index 0000000..03cb070 --- /dev/null +++ b/fedora/39.Dockerfile @@ -0,0 +1,21 @@ +FROM fedora:39 + +LABEL maintainer='Anton Melekhin' + +ENV container=docker + +RUN INSTALL_PKGS='findutils initscripts iproute python3 sudo' \ + && dnf makecache && dnf install -y $INSTALL_PKGS \ + && dnf clean all + +RUN find /etc/systemd/system \ + /lib/systemd/system \ + -path '*.wants/*' \ + -not -name '*journald*' \ + -not -name '*systemd-tmpfiles*' \ + -not -name '*systemd-user-sessions*' \ + -print0 | xargs -0 rm -vf + +VOLUME [ "/sys/fs/cgroup" ] + +ENTRYPOINT [ "/usr/sbin/init" ] \ No newline at end of file diff --git a/fedora/40.Dockerfile b/fedora/40.Dockerfile new file mode 100644 index 0000000..33867b3 --- /dev/null +++ b/fedora/40.Dockerfile @@ -0,0 +1,21 @@ +FROM fedora:40 + +LABEL maintainer='Anton Melekhin' + +ENV container=docker + +RUN INSTALL_PKGS='findutils initscripts iproute python3 sudo' \ + && dnf makecache && dnf install -y $INSTALL_PKGS \ + && dnf clean all + +RUN find /etc/systemd/system \ + /lib/systemd/system \ + -path '*.wants/*' \ + -not -name '*journald*' \ + -not -name '*systemd-tmpfiles*' \ + -not -name '*systemd-user-sessions*' \ + -print0 | xargs -0 rm -vf + +VOLUME [ "/sys/fs/cgroup" ] + +ENTRYPOINT [ "/usr/sbin/init" ] \ No newline at end of file