-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.firefox_java6_x11vnc
84 lines (74 loc) · 2.86 KB
/
Dockerfile.firefox_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
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 \
&& apt-get clean
# Install Firefox and Java Plugins
run \
apt-get update \
&& apt-get install -y firefox icedtea-6-plugin icedtea-netx openjdk-6-jre openjdk-6-jre-headless tzdata-java \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get clean \
&& mkdir ~/.vnc \
&& mkdir -p /usr/local/bin
COPY src/firefox /usr/local/bin/firefox.sh
# 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/firefox.sh \
&& 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/firefox.sh" >> ~/.i3/config
# 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