Skip to content

Commit

Permalink
Merge pull request #12621 from mpurg/ubuntu2404_dockerfile
Browse files Browse the repository at this point in the history
Add dockerfile for Ubuntu 24.04
  • Loading branch information
dodys authored Nov 26, 2024
2 parents 3ed7d8d + c2e41d5 commit 5485f6d
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions Dockerfiles/test_suite-ubuntu2404
Original file line number Diff line number Diff line change
@@ -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"]

0 comments on commit 5485f6d

Please sign in to comment.