-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.dl160_g5g6_java6_x11vnc
85 lines (75 loc) · 2.95 KB
/
Dockerfile.dl160_g5g6_java6_x11vnc
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
FROM f69m/ubuntu32:14.04
LABEL maintainer="[email protected]"
ENV DEBIAN_FRONTEND noninteractive
# make sure the package repository is up to date
run \
echo "deb http://old-releases.ubuntu.com/ubuntu precise main universe multiverse restricted" > /etc/apt/sources.list \
&& apt-get update \
&& apt-get clean
RUN \
apt-get update \
&& apt-get install -y \
# X Server
xvfb \
# VNC Server
x11vnc \
# Window manager
i3 \
# Window manager required tools
feh pulseaudio-utils xbacklight alsa-tools clipit gcc git terminator locate pcmanfm \
acpi libnotify-bin wget \
&& wget -O fonts-font-awesome_4.5.0~dfsg-1_all.deb http://archive.ubuntu.com/ubuntu/pool/main/f/fonts-font-awesome/fonts-font-awesome_4.5.0~dfsg-1_all.deb \
&& dpkg -i fonts-font-awesome_4.5.0~dfsg-1_all.deb \
# Clean up the apt cache
&& apt-get clean
# Install the specific tzdata-java we need
run \
apt-get update \
&& wget --no-check-certificate https://launchpad.net/ubuntu/+archive/primary/+files/tzdata-java_2016j-0ubuntu0.14.04_all.deb \
&& dpkg -i tzdata-java_2016j-0ubuntu0.14.04_all.deb \
&& apt-get install -y tzdata openjdk-6-jre-headless icedtea-netx \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get clean \
&& mkdir ~/.vnc \
&& mkdir -p /opt/DL160-G5G6 \
&& mkdir -p /usr/local/bin
# Add application to manage DL160
COPY resources/java-settings/java-6-openjdk/java.security /etc/java-6-openjdk/security/java.security
COPY resources/machine-types/DL160-G5G6/M2.JAR /opt/DL160-G5G6/M2.JAR
COPY src/m2 /usr/local/bin/m2
# Autostart firefox (might not be the best way to do it, but it does the trick)
RUN \
mkdir -p ~/.i3 \
&& chmod 755 /usr/local/bin/m2 \
&& cp /etc/i3/config ~/.i3/config \
&& sed -i 's/status_command i3status//' ~/.i3/config \
&& setcap -r `which i3status` \
&& echo "workspace_layout tabbed" >> ~/.i3/config \
&& echo "exec_always /usr/local/bin/m2" >> ~/.i3/config
# Entry point
#x11vnc -forever -create
# Run x11vnc
CMD \
# X Server
cd /root \
&& rm -f /tmp/.X1-lock \
&& xvfb-run -f /root/.xvfbauth -n ${SERVERNUM:-1} -s '-screen 0 1600x900x16' i3 & \
# VNC Server
if [ -z $VNC_PASSWD ]; then \
# no password
if [ -z $VNC_PORT ]; then \
nohup x11vnc -auth /root/.xvfbauth -display :${SERVERNUM:-1} -xkb -localhost -forever; \
else \
nohup x11vnc -auth /root/.xvfbauth -display :${SERVERNUM:-1} -xkb -localhost -forever -rfbport ${VNC_PORT}; \
fi; \
else \
# set password from VNC_PASSWD env variable
mkdir -p ~/.x11vnc \
&& sleep 3 \
&& x11vnc -storepasswd $VNC_PASSWD /root/.x11vnc/passwd \
&& if [ -z $VNC_PORT ]; then \
nohup x11vnc -auth /root/.xvfbauth -display :${SERVERNUM:-1} -xkb -localhost -forever -rfbauth /root/.x11vnc/passwd; \
else \
nohup x11vnc -auth /root/.xvfbauth -display :${SERVERNUM:-1} -xkb -localhost -forever -rfbauth /root/.x11vnc/passwd -rfbport ${VNC_PORT}; \
fi; \
fi