1 # |
|
2 # Dockerfile for Beremiz |
|
3 # This container is used to run tests for Beremiz |
|
4 # |
|
5 FROM ubuntu:focal |
|
6 |
|
7 ENV TERM xterm-256color |
|
8 |
|
9 ENV LANG en_US.UTF-8 |
|
10 ENV LANGUAGE en_US:en |
|
11 ENV LC_ALL en_US.UTF-8 |
|
12 |
|
13 ARG UNAME=testing |
|
14 ENV UNAME ${UNAME} |
|
15 ARG UID=1000 |
|
16 ARG GID=1000 |
|
17 RUN groupadd -g $GID $UNAME |
|
18 RUN useradd -m -u $UID -g $GID -s /bin/bash $UNAME |
|
19 |
|
20 RUN set -xe \ |
|
21 && apt-get update \ |
|
22 && TZ="America/Paris" \ |
|
23 DEBIAN_FRONTEND="noninteractive" \ |
|
24 apt-get install -y --no-install-recommends \ |
|
25 `# to run sikuli` \ |
|
26 wget \ |
|
27 libopencv4.2-java \ |
|
28 openjdk-11-jre \ |
|
29 \ |
|
30 `# to run X based tests` \ |
|
31 fluxbox \ |
|
32 wmctrl xdotool xvfb \ |
|
33 x11vnc xterm xnest \ |
|
34 materia-gtk-theme \ |
|
35 \ |
|
36 `# to build tested apps` \ |
|
37 build-essential automake flex bison mercurial \ |
|
38 libgtk-3-dev libgl1-mesa-dev libglu1-mesa-dev \ |
|
39 libpython2.7-dev libssl-dev \ |
|
40 python2 virtualenv cmake |
|
41 |
|
42 |
|
43 # force bigger font and flat theme for GTK in order to make OCR more reliable |
|
44 RUN mkdir -p /etc/gtk-3.0 |
|
45 RUN env echo -e '[Settings]\ngtk-font-name=FreeSans,12\ngtk-theme-name=Materia\n' > /etc/gtk-3.0/settings.ini |
|
46 |
|
47 # link obtained from https://raiman.github.io/SikuliX1/downloads.html |
|
48 RUN set -xe && \ |
|
49 wget -qP /usr/local/bin \ |
|
50 https://launchpad.net/sikuli/sikulix/2.0.5/+download/sikulixide-2.0.5.jar && \ |
|
51 echo 0795f1e0866ee5a7a84e4c89793ea78c /usr/local/bin/sikulixide-2.0.5.jar | md5sum -c && \ |
|
52 ( echo '#!/bin/sh' && \ |
|
53 echo "exec java -jar /usr/local/bin/sikulixide-*.jar \"\$@\"" \ |
|
54 ) | install /dev/stdin /usr/local/bin/sikulix |
|
55 |
|
56 |
|
57 RUN env echo -e '#!/bin/bash\nmake -f /home/testing/src/beremiz/tests/Makefile $*' > /usr/local/bin/do_tests |
|
58 RUN chmod +x /usr/local/bin/do_tests |
|
59 |
|
60 USER $UNAME |
|
61 |
|
62 RUN mkdir /home/$UNAME/build /home/$UNAME/src /home/$UNAME/test |
|
63 |
|
64 RUN virtualenv --python=$(which python2) ~/beremizenv |
|
65 |
|
66 RUN ~/beremizenv/bin/pip install \ |
|
67 pytest pytest-timeout ddt \ |
|
68 lxml future matplotlib zeroconf2 enum34 pyro sslpsk posix_spawn \ |
|
69 twisted nevow autobahn click opcua \ |
|
70 wxPython==4.1.1 |
|
71 |
|
72 # Point to python binary test scripts will use |
|
73 ENV BEREMIZPYTHONPATH /home/$UNAME/beremizenv/bin/python |
|
74 |
|
75 # easy to remember 'do_tests' alias to invoke main makefile |
|
76 ARG OWNDIRBASENAME=beremiz |
|
77 ENV OWNDIRBASENAME ${OWNDIRBASENAME} |
|
78 |
|
79 |
|