-
Notifications
You must be signed in to change notification settings - Fork 4
/
Dockerfile.cinnamon
50 lines (37 loc) · 1.63 KB
/
Dockerfile.cinnamon
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#FROM ubuntu:jammy-20230425
FROM ubuntu:lunar-20230615
# RUN apt update && \
# DEBIAN_FRONTEND=noninteractive apt install -y cinnamon locales sudo
# RUN apt update && \
# DEBIAN_FRONTEND=noninteractive apt install -y cinnamon-desktop-environment locales sudo
RUN apt update && \
DEBIAN_FRONTEND=noninteractive apt install -y ubuntucinnamon-desktop locales sudo
RUN apt update && \
DEBIAN_FRONTEND=noninteractive apt install -y xrdp tigervnc-standalone-server && \
adduser xrdp ssl-cert && \
locale-gen en_US.UTF-8 && \
update-locale LANG=en_US.UTF-8
ARG USER=testuser
ARG PASS=1234
RUN useradd -m $USER -p $(openssl passwd $PASS) && \
usermod -aG sudo $USER && \
chsh -s /bin/bash $USER
RUN echo "#!/bin/sh\n\
export XDG_SESSION_DESKTOP=cinnamon\n\
export XDG_SESSION_TYPE=x11\n\
export XDG_CURRENT_DESKTOP=X-Cinnamon\n\
export XDG_CONFIG_DIRS=/etc/xdg/xdg-cinnamon:/etc/xdg" > /env && chmod 555 /env
RUN echo "#!/bin/sh\n\
. /env\n\
exec dbus-run-session -- cinnamon-session" > /xstartup && chmod +x /xstartup
RUN mkdir /home/$USER/.vnc && \
echo $PASS | vncpasswd -f > /home/$USER/.vnc/passwd && \
chmod 0600 /home/$USER/.vnc/passwd && \
chown -R $USER:$USER /home/$USER/.vnc
RUN cp -f /xstartup /etc/xrdp/startwm.sh && \
cp -f /xstartup /home/$USER/.vnc/xstartup
RUN echo "#!/bin/sh\n\
sudo -u $USER -g $USER -- vncserver -rfbport 5902 -geometry 1920x1080 -depth 24 -verbose -localhost no -autokill no" > /startvnc && chmod +x /startvnc
EXPOSE 3389
EXPOSE 5902
CMD service dbus start; /usr/lib/systemd/systemd-logind & service xrdp start; /startvnc; bash