diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 02fa483..1f0a224 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -35,6 +35,10 @@ jobs: - dockerfile: dockerfiles/Ubuntu image: ghcr.io/rheinwerk/molecule:ubuntu-22.04 build-args: "OS_VERSION=22.04" + - dockerfile: dockerfiles/Debian + image: ghcr.io/rheinwerk/molecule:debian-12 + build-args: "OS_VERSION=bookworm" + steps: - name: Checkout uses: actions/checkout@v4 diff --git a/README.md b/README.md index 8cec6b3..eb92de9 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ Based on latest alpine with following software: ## Ubuntu -Upstream Ubuntu 20.04 / 22.04 Docker Container with following extensions: +Upstream Ubuntu 20.04 / 22.04 | Debian 12 Docker Container with following extensions: - Cron - DNSmasq @@ -35,7 +35,7 @@ This will test your role against the following Ansible Scenarios: - `ansible_next` - `ansible_latest` -Used Ansible Version for these scenarios are defined in [action.yml](examples/action.yml), but can be overridden. Leave `ansible_scenario` unset for simple tests against latest ansible and molecule version. +Used Ansible Version for these scenarios are defined in [action.yml](examples/action.yml), but can be overridden. Leave `ansible_scenario` unset for simple tests against latest ansible and molecule version. # Configuration ## Only Lint, no Molecule Tests diff --git a/dockerfiles/Debian b/dockerfiles/Debian new file mode 100644 index 0000000..31a216a --- /dev/null +++ b/dockerfiles/Debian @@ -0,0 +1,66 @@ +ARG OS_VERSION=stable + +FROM --platform=$BUILDPLATFORM debian:${OS_VERSION} + +ARG DEBIAN_FRONTEND=noninteractive + +# Install dependencies. +RUN apt-get update \ + && apt-get install -y --no-install-recommends \ + apt-transport-https \ + bash \ + gnupg \ + ca-certificates \ + curl \ + cron \ + dnsmasq \ + iproute2 \ + locales \ + lsb-release \ + procps \ + python3-minimal \ + python3-apt \ + python3-pip \ + python3-setuptools \ + python3-simplejson \ + python3-debian \ + rsyslog \ + software-properties-common \ + sudo \ + systemd \ + systemd-sysv \ + tar \ + unzip \ + wget \ + xz-utils \ + zip \ + && apt-get clean \ + && rm -Rf /var/lib/apt/lists/* \ + && rm -Rf /usr/share/doc && find /usr/share/man -type f -delete \ + && rm -rf /tmp/* /var/tmp/* ; \ + rm -rf /lib/systemd/system/multi-user.target.wants/* ; \ + rm -rf /etc/systemd/system/*.wants/* ; \ + rm -rf /lib/systemd/system/local-fs.target.wants/* ; \ + rm -rf /lib/systemd/system/sockets.target.wants/*udev* ; \ + rm -rf /lib/systemd/system/sockets.target.wants/*initctl* ; \ + rm -rf /lib/systemd/system/sysinit.target.wants/systemd-tmpfiles-setup* ; \ + rm -rf /lib/systemd/system/systemd-update-utmp* ; \ + rm -rf /lib/systemd/system/getty.target + +# Install Python 3.12 +RUN wget -qO- https://pascalroeleven.nl/deb-pascalroeleven.gpg | sudo tee /etc/apt/keyrings/deb-pascalroeleven.gpg +RUN echo "\ +Types: deb\n\ +URIs: http://deb.pascalroeleven.nl/python3.12\n\ +Suites: bookworm-backports\n\ +Components: main\n\ +Signed-By: /etc/apt/keyrings/deb-pascalroeleven.gpg" \ +> /etc/apt/sources.list.d/pascalroeleven.sources + +RUN apt-get update \ + && apt-get -y install python3.12 python3.12-dev python3.12-venv + +# Fix potential UTF-8 errors with ansible-test. +RUN locale-gen en_US.UTF-8 + +CMD ["/lib/systemd/systemd"]