Update Dockerfile

This commit is contained in:
Christoffer Martinsson 2024-04-13 21:30:40 +02:00
parent 3312602494
commit 302a051ab5

View File

@ -1,8 +1,8 @@
FROM ubuntu:22.04 FROM ubuntu:22.04
USER root
# Update the system, install OpenSSH Server, and set up users # Update the system, install OpenSSH Server, and set up users
RUN apt-get update && apt-get upgrade -y && \ RUN apt-get update && apt-get upgrade -y && \
DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get -y install tzdata && \
apt-get install -y openssh-server git sudo udev software-properties-common locales apt-get install -y openssh-server git sudo udev software-properties-common locales
# Create user and set password for user and root user # Create user and set password for user and root user
@ -15,12 +15,6 @@ RUN mkdir /var/run/sshd && \
sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd && \ sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd && \
echo "export VISIBLE=now" >> /etc/profile echo "export VISIBLE=now" >> /etc/profile
# Set the timezone and locale
RUN DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get -y install tzdata && \
ln -fs /usr/share/zoneinfo/Europe/Stockholm /etc/localtime && \
dpkg-reconfigure -f noninteractive tzdata && \
locale-gen "en_US.UTF-8"
# Expose the SSH port # Expose the SSH port
EXPOSE 22 EXPOSE 22