-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathDockerfile
169 lines (150 loc) · 4.46 KB
/
Dockerfile
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
FROM public.ecr.aws/ubuntu/ubuntu:22.04
LABEL authors="Satish Gaikwad<[email protected]>"
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update
# Disable auto installation of recommended packages, too many unwanted packages gets installed without this
RUN apt-config dump | grep -we Recommends -e Suggests | sed s/1/0/ | tee /etc/apt/apt.conf.d/999norecommend
# Install basic system packages
RUN apt-get install -y \
ca-certificates \
software-properties-common \
&& apt-get clean
# Install desktop environment and other system tools
RUN apt-get update && apt-get -y install \
xorg \
xfce4 \
supervisor \
vim \
openssh-server \
nano \
xubuntu-desktop \
xubuntu-artwork \
xubuntu-default-settings \
xserver-xorg-video-all \
xserver-xorg-video-dummy \
xfonts-cyrillic \
xfonts-100dpi \
xfonts-75dpi \
mesa-utils \
libxcb-icccm4 \
libxcb-image0 \
libxcb-keysyms1 \
libxcb-render-util0 \
xsel \
mesa-utils-extra \
xfonts-scalable \
xorgxrdp \
dbus-x11 \
kmod \
python3-pip \
python3-dev \
python3-venv \
rsync \
build-essential \
pkg-config \
procps \
xfce4-appmenu-plugin \
xfce4-datetime-plugin \
xfce4-goodies \
xfce4-terminal \
xfce4-taskmanager \
desktop-file-utils \
fonts-dejavu \
less \
multitail \
fonts-noto \
fonts-noto-color-emoji \
fonts-ubuntu \
menu \
menu-xdg \
net-tools \
xdg-utils \
xfonts-base \
xinput \
xutils \
xz-utils \
zenity \
git \
zip \
bash \
bash-completion \
binutils \
file \
iputils-ping \
pavucontrol \
pciutils \
psmisc \
fakeroot \
fuse \
xfonts-base \
xterm \
sudo \
wget \
curl \
gpg-agent \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/*deb
# for reticulum and other development
RUN apt-get update && apt-get -y install \
openjdk-17-jdk cmake autoconf autotools-dev \
automake libtool libltdl-dev libffi-dev python3-openssl libssl-dev \
sphinx python3-sphinx-copybutton texlive-full latexmk \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/*deb
RUN apt-get update && apt-get -y install xrdp \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/*deb
## XRDP Config
RUN printf '%s\n' 'session required pam_env.so readenv=1' >> /etc/pam.d/xrdp-sesman
# send xrdp services output to stdout
RUN ln -sf /dev/stdout /var/log/xrdp.log
RUN ln -sf /dev/stdout /var/log/xrdp-sesman.log
# Disable forking, new cursors and enable high tls ciphers for xrdp
RUN sed -i "\
s/fork=true/fork=false/g; \
s/\#tls_ciphers=HIGH/tls_ciphers=HIGH/g; \
s/^new_cursors=true/new_cursors=false/g \
" /etc/xrdp/xrdp.ini
# Disable root login and syslog logging for xrdp-sesman
RUN sed -i "\
s/AllowRootLogin=true/AllowRootLogin=false/g; \
s/EnableSyslog=1/EnableSyslog=0/g \
" /etc/xrdp/sesman.ini
# Disable light-locker
RUN ln -s /usr/bin/true /usr/bin/light-locker
COPY files/supervisor.xrdp.conf /etc/supervisor/conf.d/
# Remove annoying multiple auth popups after rdp login
COPY files/46-allow-update-repo.pkla /etc/polkit-1/localauthority/50-local.d/46-allow-update-repo.pkla
# Allow all users to start xserver
RUN echo 'allowed_users=anybody' > /etc/X11/Xwrapper.config
RUN chmod g+w /etc/xrdp
RUN chmod u+s /usr/sbin/xrdp-sesman
RUN chmod u+s /usr/sbin/xrdp
# Install firefox and get rid of snapd
RUN add-apt-repository -y ppa:mozillateam/ppa && \
apt-get -y update && \
apt-get -y upgrade && \
apt-get -y purge snapd ;\
apt-get -y install firefox-esr && \
apt-get clean
## User Config
RUN useradd -d /home/guest -s /bin/bash -c "Guest User" guest
# Add xrdp user to ssl-cert to allow access to cert files generated by system
RUN usermod -a -G ssl-cert xrdp
# Allow guest to be sudo to install any new packages
RUN usermod -a -G sudo guest
RUN echo '%guest ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
RUN mkdir /home/guest
RUN echo 'guest:guest' | chpasswd
# Copy xsessionrc file as template inside.
# Docker entrypint script will copy this file into guest home dir.
COPY files/xsessionrc /xsessionrc
RUN chown -Rf guest:guest /home/guest/
# DBus config
RUN mkdir -p /var/run/dbus
RUN chown messagebus:messagebus /var/run/dbus
RUN dbus-uuidgen > /var/lib/dbus/machine-id
COPY docker-entrypoint /docker-entrypoint
EXPOSE 3389
ENTRYPOINT ["/docker-entrypoint"]
CMD [ "/usr/bin/supervisord", "-n" ]