-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathDockerfile
More file actions
154 lines (131 loc) · 3.87 KB
/
Copy pathDockerfile
File metadata and controls
154 lines (131 loc) · 3.87 KB
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
FROM mohamedhelmy/android-docker:34
MAINTAINER Mohamed Helmy <helmy419@gmail.com>
###
# Deskstop/BASE noVNC
###
ENV DEBIAN_FRONTEND=noninteractive \
TZ=EET \
HOME=/root \
DISPLAY_WIDTH=1920 \
DISPLAY_HEIGHT=1080 \
WEB_LISTENING_PORT=5800 \
VNC_LISTENING_PORT=5900
RUN apt-get update && \
apt-get -yq dist-upgrade && \
apt-get install -yq --no-install-recommends \
wget \
curl \
bzip2 \
ca-certificates \
apt-utils \
software-properties-common \
openssl \
tini \
pwgen \
sudo \
netcat \
vim-tiny \
net-tools \
sed \
jq \
npm \
unzip \
python3-pip \
xterm \
supervisor \
socat \
x11vnc \
openbox \
feh \
menu \
python-numpy \
net-tools \
ffmpeg \
jq \
qemu-kvm \
libvirt-daemon-system \
libvirt-clients\
virtinst \
virt-manager \
bridge-utils \
build-essential \
iputils-ping \
lxde \
lxde-common \
xterm \
xfce4-terminal \
firefox \
htop \
screen
# create an emuhub user
RUN useradd --create-home --shell /bin/bash --user-group emuhub
RUN echo "emuhub:emuhub" | chpasswd
RUN usermod -aG libvirt emuhub
RUN usermod -aG kvm emuhub
RUN usermod -aG sudo emuhub
COPY ./user-configuration/images /home/emuhub/images
COPY ./user-configuration/.config /home/emuhub/.config
COPY ./user-configuration/.Xauthority /home/emuhub/.Xauthority
COPY ./user-configuration/.bashrc /home/emuhub/.bashrc
RUN touch /home/emuhub/.sudo_as_admin_successful
# create avd
COPY emulator-configuration/skins /opt/android-sdk-linux/skins
COPY emulator-configuration/emulator /home/emuhub/emulator
RUN chmod -R +x /home/emuhub/emulator
RUN chmod -R +777 /home/emuhub/.config
RUN chmod +777 /home/emuhub/.Xauthority
COPY ./user-configuration/Desktop /home/emuhub/Desktop
# Update Android SDK
RUN /opt/android-sdk-linux/cmdline-tools/tools/bin/sdkmanager --update && \
/opt/android-sdk-linux/cmdline-tools/tools/bin/sdkmanager --install "emulator" && \
/opt/android-sdk-linux/cmdline-tools/tools/bin/sdkmanager --install "system-images;android-34;google-tv;x86" && \
/opt/android-sdk-linux/cmdline-tools/tools/bin/sdkmanager --install "system-images;android-33;android-wear;x86_64"
# /opt/android-sdk-linux/cmdline-tools/tools/bin/sdkmanager --install "system-images;android-34;google_apis_playstore;x86_64" && \
RUN apt-get install -y \
tigervnc-standalone-server \
tigervnc-xorg-extension
ADD config /config
# Build noVNC
ARG NOVNC_VERSION=1.4.0
ARG NOVNC_URL=https://github.com/novnc/noVNC/archive/refs/tags/v${NOVNC_VERSION}.tar.gz
RUN npm install clean-css-cli -g
# packages websockify will need
RUN pip3 install \
numpy \
jwcrypto
# Install noVNC
RUN mkdir /noVNC && \
curl -# -L ${NOVNC_URL} | tar -xz --strip 1 -C /noVNC
COPY config/index.html /noVNC/index.html
COPY config/app/imgs /noVNC/app/imgs
WORKDIR /tmp
# Install websockify
RUN wget https://github.com/novnc/websockify/archive/refs/tags/v0.11.0.tar.gz -O /tmp/websockify.tgz && \
tar -zxf /tmp/websockify.tgz && \
rm /tmp/websockify.tgz && \
cd /tmp/websockify* && \
python3 setup.py install
# Set version of CSS and JavaScript file URLs
RUN sed "s/UNIQUE_VERSION/$(date | md5sum | cut -c1-10)/g" -i /noVNC/index.html
EXPOSE 6080
### RDP ###
RUN apt install -y xrdp
RUN touch /var/log/xrdp-sesman.log && touch /var/log/xrdp.log
RUN chmod +66 /var/log/xrdp-sesman.log
RUN chmod +66 /var/log/xrdp.log
RUN mkdir /var/run/xrdp
RUN chown xrdp:xrdp /var/run/xrdp
RUN chmod +777 /var/run/xrdp
RUN chown emuhub:emuhub -R /etc/xrdp
EXPOSE 3350
EXPOSE 3389
# remove clipit and deluge packages to get rid of more annoying UI stuff
RUN apt-get remove -y \
clipit \
deluge
RUN /config/cleanup-cruft.sh
### Finish Build
ADD start-vnc.sh /usr/local/bin/start-vnc.sh
ENTRYPOINT ["tini", "--"]
CMD ["/usr/local/bin/start-vnc.sh"]
WORKDIR /home/emuhub