From c2e41d5170434723eda0e874f6cab70b3aa0cbce Mon Sep 17 00:00:00 2001 From: Miha Purg Date: Fri, 15 Nov 2024 22:14:41 +0100 Subject: [PATCH] Added dockerfile for Ubuntu 24.04 --- Dockerfiles/test_suite-ubuntu2404 | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 Dockerfiles/test_suite-ubuntu2404 diff --git a/Dockerfiles/test_suite-ubuntu2404 b/Dockerfiles/test_suite-ubuntu2404 new file mode 100644 index 00000000000..32292da68b7 --- /dev/null +++ b/Dockerfiles/test_suite-ubuntu2404 @@ -0,0 +1,25 @@ +# This Dockerfile is a minimal example for a Ubuntu 24.04 test suite target container. +FROM ubuntu:24.04 + +ENV AUTH_KEYS=/root/.ssh/authorized_keys + +ARG CLIENT_PUBLIC_KEY +ARG DEBIAN_FRONTEND=noninteractive + +# Install Python so Ansible remediations can work +# Don't clean all, as the test scenario may require package install. +RUN true \ + && apt update \ + && apt install -y openscap-utils openscap-scanner \ + && apt install -y openssh-server + +RUN true \ + && ssh-keygen -A \ + && mkdir -p /root/.ssh \ + && printf "%s\n" "$CLIENT_PUBLIC_KEY" >> "$AUTH_KEYS" \ + && chmod og-rw /root/.ssh "$AUTH_KEYS" \ + && sed -i '/session\s\+required\s\+pam_loginuid.so/d' /etc/pam.d/sshd \ + && echo CPE_NAME="cpe:/o:canonical:ubuntu_linux:24.04" >> /etc/os-release + +RUN mkdir /run/sshd +CMD ["/usr/sbin/sshd", "-D"]