Skip to content

Instantly share code, notes, and snippets.

@csmr
Created April 8, 2024 11:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save csmr/581ce8a0467dfd1d1e5269048525df4e to your computer and use it in GitHub Desktop.
Save csmr/581ce8a0467dfd1d1e5269048525df4e to your computer and use it in GitHub Desktop.
Debian desktop docker file
#
# 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