Created
February 6, 2025 12:14
-
-
Save bliotti/2ddddf777512aadf12da6f1dd21eca2d to your computer and use it in GitHub Desktop.
unning-ubuntu-os-with-gui-in-a-docker-container
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
https://medium.com/cloud-for-all/running-ubuntu-os-with-gui-in-a-docker-container-rdp-dbecb0880893 | |
FROM ubuntu:22.04 | |
# Install dependencies, Lubuntu desktop, and XRDP | |
RUN apt update && \ | |
DEBIAN_FRONTEND=noninteractive apt install -y \ | |
lubuntu-desktop xrdp sudo && \ | |
apt clean && rm -rf /var/lib/apt/lists/* | |
# Create a user and add to sudo group | |
RUN useradd -m -s /bin/bash testuser && \ | |
echo "testuser:1234" | chpasswd && \ | |
usermod -aG sudo testuser | |
# Configure XRDP | |
RUN adduser xrdp ssl-cert && \ | |
echo "testuser" > /etc/xrdp/xrdp.ini | |
# Expose XRDP port | |
EXPOSE 3389 | |
# Start XRDP service | |
CMD ["/usr/sbin/xrdp", "-ns"] | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment