-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.sakuli-base
132 lines (117 loc) · 4.93 KB
/
Dockerfile.sakuli-base
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
# This Dockerfile is used to build an headles vnc image based on Ubuntu
# Used to run CI jobs for nut.js
ARG BASE_IMAGE_VERSION=18.04
FROM ubuntu:$BASE_IMAGE_VERSION
ARG NODE_VERSION
ARG BUILD_DATE
# Ensure mandatory args are set
RUN test -n "${NODE_VERSION}" && \
test -n "${BUILD_DATE}"
ENV REFRESHED_AT=${BUILD_DATE} \
LANG='en_US.UTF-8' \
LANGUAGE='en_US:en' \
LC_ALL='en_US.UTF-8' \
DISPLAY=:1 \
VNC_PORT=5901 \
NO_VNC_PORT=6901 \
HOME=/headless \
TERM=xterm \
STARTUPDIR=/dockerstartup \
INST_SCRIPTS=/headless/install \
NO_VNC_HOME=/headless/noVNC \
DEBIAN_FRONTEND=noninteractive \
VNC_COL_DEPTH=24 \
VNC_RESOLUTION=1280x1024 \
VNC_PW=vncpassword \
VNC_VIEW_ONLY=false \
IMG=taconsol/sakuli-base \
TESSDATA_PREFIX=/usr/local/share/tessdata \
npm_config_cache=/headless/Documents
EXPOSE $VNC_PORT $NO_VNC_PORT
WORKDIR $HOME
### Copy all install scripts for further steps
COPY ./src/common/install/ $INST_SCRIPTS/
RUN find $INST_SCRIPTS -name '*.sh' -exec chmod a+x {} +
### Copy tesseract
COPY ./src/tesseract /tmp/tesseract
### Install required packages and add configuration
RUN apt-get update && \
apt-get install -y \
wget \
locales \
gnome-calculator \
xfce4-screenshooter \
git \
nitrogen \
rsync \
libnss3-tools \
build-essential \
libxtst-dev \
net-tools \
python-numpy \
chromium-browser \
chromium-chromedriver \
chromium-browser-l10n \
chromium-codecs-ffmpeg \
firefox \
firefox-geckodriver \
firefox-locale-de \
openbox \
obconf \
obmenu \
xterm \
x11-xkb-utils \
libnss-wrapper \
gettext \
curl \
iputils-ping \
iputils-tracepath \
dnsutils \
libleptonica-dev \
libpng-dev \
libjpeg8-dev \
libtiff5-dev \
zlib1g-dev \
libtool \
software-properties-common \
xinit && \
add-apt-repository ppa:ubuntu-toolchain-r/test && \
apt update && \
apt install -y gcc-9 libstdc++6 && \
apt-get clean -y && \
apt-get autoremove -y && \
rm -rf /var/lib/apt/lists/* /var/cache/apt/* && \
locale-gen en_US.UTF-8 && \
locale-gen de_DE.UTF-8 && \
TIGERVNC_VERSION=$(curl -s -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/TigerVNC/tigervnc/releases/latest | grep "tag_name" | cut -d ":" -f 2 | cut -d "\"" -f 2 | cut -d "v" -f 2) && \
echo TIGERVNC_VERSION=$TIGERVNC_VERSION && \
wget -qO- https://sourceforge.net/projects/tigervnc/files/stable/$TIGERVNC_VERSION/tigervnc-$TIGERVNC_VERSION.x86_64.tar.gz | tar xz --strip 1 --no-same-owner --no-same-permissions -C / && \
mkdir -p $NO_VNC_HOME/utils/websockify && \
NOVNC_VERSION=$(curl -s https://api.github.com/repos/novnc/novnc/releases/latest | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/') && \
echo NOVNC_VERSION=$NOVNC_VERSION && \
wget -qO- https://github.com/novnc/noVNC/archive/$NOVNC_VERSION.tar.gz | tar xz --strip 1 -C $NO_VNC_HOME && \
WEBSOCKIFY_VERSION=$(curl -s https://api.github.com/repos/novnc/websockify/releases/latest | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/') && \
echo WEBSOCKIFY_VERSION=$WEBSOCKIFY_VERSION && \
wget -qO- https://github.com/novnc/websockify/archive/$WEBSOCKIFY_VERSION.tar.gz | tar xz --strip 1 -C $NO_VNC_HOME/utils/websockify && \
ln -s $NO_VNC_HOME/vnc_lite.html $NO_VNC_HOME/index.html && \
ln -s /usr/bin/chromium-browser /usr/bin/google-chrome && \
echo "CHROMIUM_FLAGS='--no-sandbox --user-data-dir'" > $HOME/.chromium-browser.init && \
dpkg -i /tmp/tesseract/tesseract_4.1.1-1_amd64.deb && \
ldconfig && \
cp /tmp/tesseract/*traineddata /usr/local/share/tessdata && \
rm -rf /tmp/tesseract
COPY ./src/common/wm/ $HOME/
COPY ./src/common/config/openbox /etc/xdg/openbox
COPY ./src/common/config/vnc $HOME/.vnc
### Copy env scripts for startup
COPY ./src/common/env/ $STARTUPDIR/env
COPY ./src/common/firefox_profile/certificate-profile $HOME/firefox-certificates/
COPY ./src/common/chrome_certificate_store/ $HOME/.pki/
RUN mkdir -m 777 /headless/.config && mkdir -m 777 /headless/.npm_cache && mkdir -m 777 /headless/.mozilla
RUN $INST_SCRIPTS/set_user_permission.sh $HOME
### Create vncserver command
COPY ./src/common/vnc/vncserver /usr/bin
RUN chmod 755 /usr/bin/vncserver
USER 1000:1000
### Install nvm
RUN $INST_SCRIPTS/nvm.sh $NODE_VERSION