From 6725e4cc8f4e91b4215813171fa06d365721abed Mon Sep 17 00:00:00 2001 From: Ahmed Abdelhalim Date: Thu, 4 Sep 2025 00:25:57 +0200 Subject: Refactor molecule testing to run a scenario per distro --- molecule/ubuntu/Dockerfile.j2 | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 molecule/ubuntu/Dockerfile.j2 (limited to 'molecule/ubuntu/Dockerfile.j2') diff --git a/molecule/ubuntu/Dockerfile.j2 b/molecule/ubuntu/Dockerfile.j2 new file mode 100644 index 00000000..37199b55 --- /dev/null +++ b/molecule/ubuntu/Dockerfile.j2 @@ -0,0 +1,30 @@ +# Based on the amazing work of geerlingguy <3 +# FROM docker.io/geerlingguy/docker-ubuntu2404-ansible +FROM docker.io/library/ubuntu:noble + +ARG DEBIAN_FRONTEND=noninteractive + +ENV container docker + +RUN apt-get update \ + && apt-get install -y --no-install-recommends \ + locales systemd avahi-daemon python3 iproute2 ifupdown \ + && rm -Rf /var/lib/apt/lists/* \ + && rm -Rf /usr/share/doc \ + && rm -Rf /usr/share/man \ + && apt-get clean + +# Fix potential UTF-8 errors with ansible-test. +RUN locale-gen en_US.UTF-8 + +# Remove unnecessary getty and udev targets that result in high CPU usage when using +# multiple containers with Molecule (https://github.com/ansible/molecule/issues/1104) +RUN rm -f /lib/systemd/system/systemd*udev* \ + && rm -f /lib/systemd/system/getty.target + +# Mimic Ubuntu OS default boot (for testing) +RUN systemctl enable avahi-daemon + +VOLUME ["/sys/fs/cgroup", "/tmp", "/run", "/opt"] + +CMD ["/lib/systemd/systemd"] -- cgit v1.2.3