Created
April 8, 2024 11:16
-
-
Save csmr/581ce8a0467dfd1d1e5269048525df4e to your computer and use it in GitHub Desktop.
Debian desktop docker file
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
# | |
# Dockerfile | |
# | |
# Use Debian as the base image | |
FROM debian:latest | |
# Install desktop environment | |
RUN apt-get update && \ | |
apt-get install -y xfce4 firefox thunderbird libreoffice gimp | |
# Set timezone | |
RUN echo "America/Los_Angeles" > /etc/timezone && \ | |
dpkg-reconfigure -f noninteractive tzdata | |
# Configure locale | |
RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \ | |
dpkg-reconfigure -f noninteractive locales | |
# Create user account | |
RUN useradd -m -s /bin/bash user && \ | |
echo "user:password" | chpasswd && \ | |
usermod -aG sudo user | |
# Copy SSH authorized keys | |
COPY authorized_keys /home/user/.ssh/ | |
RUN chown -R user:user /home/user/.ssh && \ | |
chmod 700 /home/user/.ssh && \ | |
chmod 600 /home/user/.ssh/authorized_keys | |
# Disable root login | |
RUN sed -i -e 's/#PermitRootLogin prohibit-password/PermitRootLogin no/' /etc/ssh/sshd_config | |
# Set the default command to start the Xfce desktop environment | |
CMD ["startxfce4"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment