summaryrefslogtreecommitdiffstats
path: root/molecule/default/Dockerfile.ubuntu.j2
diff options
context:
space:
mode:
authorAhmed AbdelHalim <[email protected]>2025-08-11 00:32:00 +0200
committerAhmed AbdelHalim <[email protected]>2025-08-11 00:32:00 +0200
commit5378856a4d171815e800671db07365c6e9fbf496 (patch)
tree8f0bded9360fde2cb6779d4e8cd50d41a3741c4c /molecule/default/Dockerfile.ubuntu.j2
parent36f51ca34f718239d2618ae5d027a7d5d366f864 (diff)
Add network role
Diffstat (limited to 'molecule/default/Dockerfile.ubuntu.j2')
-rw-r--r--molecule/default/Dockerfile.ubuntu.j229
1 files changed, 29 insertions, 0 deletions
diff --git a/molecule/default/Dockerfile.ubuntu.j2 b/molecule/default/Dockerfile.ubuntu.j2
new file mode 100644
index 00000000..4cf904ed
--- /dev/null
+++ b/molecule/default/Dockerfile.ubuntu.j2
@@ -0,0 +1,29 @@
+# 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 \
+ && apt-get clean \
+ && rm -Rf /var/lib/apt/lists/* \
+ && rm -Rf /usr/share/doc \
+ && rm -Rf /usr/share/man
+
+# 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"]