Dockerfile 971 B

123456789101112131415161718192021222324252627282930313233343536
  1. FROM ubuntu:24.04
  2. ENV DEBIAN_FRONTEND=noninteractive
  3. RUN apt-get update && apt-get install -y --no-install-recommends \
  4. xfce4 \
  5. xfce4-goodies \
  6. dbus-x11 \
  7. tigervnc-standalone-server \
  8. tigervnc-common \
  9. novnc \
  10. websockify \
  11. sudo \
  12. wget \
  13. curl \
  14. nano \
  15. git \
  16. && apt-get clean \
  17. && rm -rf /var/lib/apt/lists/*
  18. # ubuntu:24.04 already ships a default "ubuntu" user (uid 1000); just grant it passwordless sudo
  19. RUN echo "ubuntu ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/ubuntu \
  20. && chmod 0440 /etc/sudoers.d/ubuntu
  21. # Keep these outside /home/ubuntu: that directory is replaced by a named
  22. # volume at runtime (for persistence), which would otherwise shadow them.
  23. COPY scripts/xstartup /opt/vnc/xstartup
  24. COPY scripts/entrypoint.sh /usr/local/bin/entrypoint.sh
  25. RUN chmod +x /opt/vnc/xstartup /usr/local/bin/entrypoint.sh
  26. USER ubuntu
  27. WORKDIR /home/ubuntu
  28. EXPOSE 5901 6901
  29. ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]