Falln87 commited on
Commit
eb1c3fb
1 Parent(s): 6901e59

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +56 -0
Dockerfile ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM ubuntu:focal
2
+
3
+ ENV DEBIAN_FRONTEND=noninteractive
4
+
5
+ # INSTALL SOURCES FOR CHROME REMOTE DESKTOP AND VSCODE
6
+ RUN apt-get update && apt-get upgrade --assume-yes
7
+ RUN apt-get --assume-yes install curl gpg wget
8
+ RUN curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg && \
9
+ mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg
10
+ RUN wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | apt-key add -
11
+ RUN echo "deb [arch=amd64] http://packages.microsoft.com/repos/vscode stable main" | \
12
+ tee /etc/apt/sources.list.d/vs-code.list
13
+ RUN sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'
14
+ # INSTALL XFCE DESKTOP AND DEPENDENCIES
15
+ RUN apt-get update && apt-get upgrade --assume-yes
16
+ RUN apt-get install --assume-yes --fix-missing sudo wget apt-utils xvfb xfce4 xbase-clients \
17
+ desktop-base vim xscreensaver google-chrome-stable python-psutil psmisc python3-psutil xserver-xorg-video-dummy ffmpeg
18
+ RUN apt-get install --assume-yes python3-packaging python3-xdg
19
+ RUN apt-get install libutempter0
20
+ RUN wget https://dl.google.com/linux/direct/chrome-remote-desktop_current_amd64.deb
21
+ RUN dpkg --install chrome-remote-desktop_current_amd64.deb
22
+ RUN apt-get install --assume-yes --fix-broken
23
+ RUN bash -c 'echo "exec /etc/X11/Xsession /usr/bin/xfce4-session" > /etc/chrome-remote-desktop-session'
24
+
25
+ RUN apt-get install --assume-yes firefox
26
+ # ----------------------------------------------------------
27
+ # SPECIFY VARIABLES FOR SETTING UP CHROME REMOTE DESKTOP
28
+ ARG USER=dockerspace
29
+ # use 6 digits at least
30
+ ENV PIN=000000
31
+ ENV CODE=4/0AQlEd8zdOl72USP-UHHrIiEQaQYDNnlJVsAFz4cZKEZE-ECm1tRbFXTPUiLdLY1GE35MYw
32
+ ENV HOSTNAME=myvirtualdesktop
33
+ # ----------------------------------------------------------
34
+ # ADD USER TO THE SPECIFIED GROUPS
35
+ RUN adduser --disabled-password --gecos '' $USER
36
+ RUN mkhomedir_helper $USER
37
+ RUN adduser $USER sudo
38
+ RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
39
+ RUN usermod -aG chrome-remote-desktop $USER
40
+ USER $USER
41
+ WORKDIR /home/$USER
42
+ RUN mkdir -p .config/chrome-remote-desktop
43
+ RUN chown "$USER:$USER" .config/chrome-remote-desktop
44
+ RUN chmod a+rx .config/chrome-remote-desktop
45
+ RUN touch .config/chrome-remote-desktop/host.json
46
+ RUN echo "/usr/bin/pulseaudio --start" > .chrome-remote-desktop-session
47
+ RUN echo "startxfce4 :1030" >> .chrome-remote-desktop-session
48
+ CMD \
49
+ DISPLAY= /opt/google/chrome-remote-desktop/start-host --code=$CODE --redirect-url="https://remotedesktop.google.com/_/oauthredirect" --name=$HOSTNAME --pin=$PIN ; \
50
+ HOST_HASH=$(echo -n $HOSTNAME | md5sum | cut -c -32) && \
51
+ FILENAME=.config/chrome-remote-desktop/host#${HOST_HASH}.json && echo $FILENAME && \
52
+ cp .config/chrome-remote-desktop/host#*.json $FILENAME ; \
53
+ sudo service chrome-remote-desktop stop && \
54
+ sudo service chrome-remote-desktop start && \
55
+ echo $HOSTNAME && \
56
+ sleep infinity & wait