-
Notifications
You must be signed in to change notification settings - Fork 706
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12621 from mpurg/ubuntu2404_dockerfile
Add dockerfile for Ubuntu 24.04
- Loading branch information
Showing
1 changed file
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |