annotate docker/backend-dev-e2e/Dockerfile @ 3573:813595f88612

merge changes from main branch
author Goffi <goffi@goffi.org>
date Thu, 17 Jun 2021 13:05:58 +0200
parents 73e04040d577
children 0ffaa231138c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3497
73e04040d577 docker: update following name changes:
Goffi <goffi@goffi.org>
parents: 3439
diff changeset
1 FROM libervia/backend:dev
3381
127dde80a0a5 docker: dockers images, first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
2
127dde80a0a5 docker: dockers images, first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
3 LABEL maintainer="Goffi <tmp_dockerfiles@goffi.org>"
127dde80a0a5 docker: dockers images, first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
4
127dde80a0a5 docker: dockers images, first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
5 USER root
127dde80a0a5 docker: dockers images, first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
6
3427
f023f06fa344 docker (backend_e2e): added packages necessary to test Libervia + some debugging tools
Goffi <goffi@goffi.org>
parents: 3385
diff changeset
7 ARG DEBIAN_FRONTEND=noninteractive
f023f06fa344 docker (backend_e2e): added packages necessary to test Libervia + some debugging tools
Goffi <goffi@goffi.org>
parents: 3385
diff changeset
8
f023f06fa344 docker (backend_e2e): added packages necessary to test Libervia + some debugging tools
Goffi <goffi@goffi.org>
parents: 3385
diff changeset
9 RUN mkdir -m 777 /reports && \
f023f06fa344 docker (backend_e2e): added packages necessary to test Libervia + some debugging tools
Goffi <goffi@goffi.org>
parents: 3385
diff changeset
10 apt-get install -y --no-install-recommends \
f023f06fa344 docker (backend_e2e): added packages necessary to test Libervia + some debugging tools
Goffi <goffi@goffi.org>
parents: 3385
diff changeset
11 # firefox is needed to test Libervia via selenium
f023f06fa344 docker (backend_e2e): added packages necessary to test Libervia + some debugging tools
Goffi <goffi@goffi.org>
parents: 3385
diff changeset
12 firefox-esr \
f023f06fa344 docker (backend_e2e): added packages necessary to test Libervia + some debugging tools
Goffi <goffi@goffi.org>
parents: 3385
diff changeset
13 # VNC/X11 server for visual mode + window manager
f023f06fa344 docker (backend_e2e): added packages necessary to test Libervia + some debugging tools
Goffi <goffi@goffi.org>
parents: 3385
diff changeset
14 # using openbox as it allows to resize easily when doing manual debugging/tests
f023f06fa344 docker (backend_e2e): added packages necessary to test Libervia + some debugging tools
Goffi <goffi@goffi.org>
parents: 3385
diff changeset
15 # and it adapts correctly when doing driver.set_window_size
f023f06fa344 docker (backend_e2e): added packages necessary to test Libervia + some debugging tools
Goffi <goffi@goffi.org>
parents: 3385
diff changeset
16 tigervnc-standalone-server openbox \
f023f06fa344 docker (backend_e2e): added packages necessary to test Libervia + some debugging tools
Goffi <goffi@goffi.org>
parents: 3385
diff changeset
17 # useful for remote debugging
f023f06fa344 docker (backend_e2e): added packages necessary to test Libervia + some debugging tools
Goffi <goffi@goffi.org>
parents: 3385
diff changeset
18 telnet net-tools \
f023f06fa344 docker (backend_e2e): added packages necessary to test Libervia + some debugging tools
Goffi <goffi@goffi.org>
parents: 3385
diff changeset
19 # needed to make Firefox trust system certificates
f023f06fa344 docker (backend_e2e): added packages necessary to test Libervia + some debugging tools
Goffi <goffi@goffi.org>
parents: 3385
diff changeset
20 # cf. https://askubuntu.com/a/1036637
f023f06fa344 docker (backend_e2e): added packages necessary to test Libervia + some debugging tools
Goffi <goffi@goffi.org>
parents: 3385
diff changeset
21 p11-kit && \
f023f06fa344 docker (backend_e2e): added packages necessary to test Libervia + some debugging tools
Goffi <goffi@goffi.org>
parents: 3385
diff changeset
22 ln -fs /usr/lib/x86_64-linux-gnu/pkcs11/p11-kit-trust.so /usr/lib/firefox-esr/libnssckbi.so
f023f06fa344 docker (backend_e2e): added packages necessary to test Libervia + some debugging tools
Goffi <goffi@goffi.org>
parents: 3385
diff changeset
23
3381
127dde80a0a5 docker: dockers images, first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
24 # we install pre-generated certificates so we can do tests with valid TLS
127dde80a0a5 docker: dockers images, first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
25 COPY --chown=root:root certificates/minica.pem /usr/local/share/ca-certificates/minica.crt
3497
73e04040d577 docker: update following name changes:
Goffi <goffi@goffi.org>
parents: 3439
diff changeset
26 COPY --chown=root:tls-cert certificates/server1.test/cert.pem /usr/share/libervia/certificates/server1.test.pem
73e04040d577 docker: update following name changes:
Goffi <goffi@goffi.org>
parents: 3439
diff changeset
27 COPY --chown=root:tls-cert certificates/server1.test/key.pem /usr/share/libervia/certificates/server1.test-key.pem
3381
127dde80a0a5 docker: dockers images, first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
28 RUN update-ca-certificates
127dde80a0a5 docker: dockers images, first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
29
3497
73e04040d577 docker: update following name changes:
Goffi <goffi@goffi.org>
parents: 3439
diff changeset
30 COPY --chown=root:root libervia.conf /etc/libervia.conf
73e04040d577 docker: update following name changes:
Goffi <goffi@goffi.org>
parents: 3439
diff changeset
31 COPY --chown=libervia:libervia scripts/entrypoint.sh /home/libervia/entrypoint_e2e.sh
3381
127dde80a0a5 docker: dockers images, first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
32
3427
f023f06fa344 docker (backend_e2e): added packages necessary to test Libervia + some debugging tools
Goffi <goffi@goffi.org>
parents: 3385
diff changeset
33 RUN \
f023f06fa344 docker (backend_e2e): added packages necessary to test Libervia + some debugging tools
Goffi <goffi@goffi.org>
parents: 3385
diff changeset
34 # we install webdriver (needed to control Firefox from Selenium)
f023f06fa344 docker (backend_e2e): added packages necessary to test Libervia + some debugging tools
Goffi <goffi@goffi.org>
parents: 3385
diff changeset
35 # note: this is not absolutely necessary as long as we use helium because it includes
f023f06fa344 docker (backend_e2e): added packages necessary to test Libervia + some debugging tools
Goffi <goffi@goffi.org>
parents: 3385
diff changeset
36 # is own webdriver
f023f06fa344 docker (backend_e2e): added packages necessary to test Libervia + some debugging tools
Goffi <goffi@goffi.org>
parents: 3385
diff changeset
37 python -c 'from urllib.request import urlretrieve;\
f023f06fa344 docker (backend_e2e): added packages necessary to test Libervia + some debugging tools
Goffi <goffi@goffi.org>
parents: 3385
diff changeset
38 urlretrieve(\
f023f06fa344 docker (backend_e2e): added packages necessary to test Libervia + some debugging tools
Goffi <goffi@goffi.org>
parents: 3385
diff changeset
39 "https://github.com/mozilla/geckodriver/releases/download/v0.28.0"\
f023f06fa344 docker (backend_e2e): added packages necessary to test Libervia + some debugging tools
Goffi <goffi@goffi.org>
parents: 3385
diff changeset
40 "/geckodriver-v0.28.0-linux64.tar.gz", "/usr/local/bin/geckodriver.tar.gz")' && \
f023f06fa344 docker (backend_e2e): added packages necessary to test Libervia + some debugging tools
Goffi <goffi@goffi.org>
parents: 3385
diff changeset
41 cd /usr/local/bin && tar zxf geckodriver.tar.gz && rm -f geckodriver.tar.gz
f023f06fa344 docker (backend_e2e): added packages necessary to test Libervia + some debugging tools
Goffi <goffi@goffi.org>
parents: 3385
diff changeset
42
3497
73e04040d577 docker: update following name changes:
Goffi <goffi@goffi.org>
parents: 3439
diff changeset
43 WORKDIR /home/libervia
73e04040d577 docker: update following name changes:
Goffi <goffi@goffi.org>
parents: 3439
diff changeset
44 USER libervia
3381
127dde80a0a5 docker: dockers images, first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
45
3427
f023f06fa344 docker (backend_e2e): added packages necessary to test Libervia + some debugging tools
Goffi <goffi@goffi.org>
parents: 3385
diff changeset
46 RUN \
f023f06fa344 docker (backend_e2e): added packages necessary to test Libervia + some debugging tools
Goffi <goffi@goffi.org>
parents: 3385
diff changeset
47 # pytest and its plugins
3439
b166a59b1724 tests, doc(testing): added `pytest-dependency` plugin to `backend_e2e` image + doc
Goffi <goffi@goffi.org>
parents: 3427
diff changeset
48 pip install pytest pytest-timeout pytest-dependency \
3427
f023f06fa344 docker (backend_e2e): added packages necessary to test Libervia + some debugging tools
Goffi <goffi@goffi.org>
parents: 3385
diff changeset
49 # needed to test jp
f023f06fa344 docker (backend_e2e): added packages necessary to test Libervia + some debugging tools
Goffi <goffi@goffi.org>
parents: 3385
diff changeset
50 sh \
f023f06fa344 docker (backend_e2e): added packages necessary to test Libervia + some debugging tools
Goffi <goffi@goffi.org>
parents: 3385
diff changeset
51 # needed to test libervia
f023f06fa344 docker (backend_e2e): added packages necessary to test Libervia + some debugging tools
Goffi <goffi@goffi.org>
parents: 3385
diff changeset
52 helium \
f023f06fa344 docker (backend_e2e): added packages necessary to test Libervia + some debugging tools
Goffi <goffi@goffi.org>
parents: 3385
diff changeset
53 # needed to check sent emails
f023f06fa344 docker (backend_e2e): added packages necessary to test Libervia + some debugging tools
Goffi <goffi@goffi.org>
parents: 3385
diff changeset
54 aiosmtpd \
f023f06fa344 docker (backend_e2e): added packages necessary to test Libervia + some debugging tools
Goffi <goffi@goffi.org>
parents: 3385
diff changeset
55 # useful for debugging
f023f06fa344 docker (backend_e2e): added packages necessary to test Libervia + some debugging tools
Goffi <goffi@goffi.org>
parents: 3385
diff changeset
56 pudb
f023f06fa344 docker (backend_e2e): added packages necessary to test Libervia + some debugging tools
Goffi <goffi@goffi.org>
parents: 3385
diff changeset
57
3385
bcdfe7905409 docker (backend_e2e): install pytest and sh
Goffi <goffi@goffi.org>
parents: 3381
diff changeset
58 RUN ./entrypoint.sh \
bcdfe7905409 docker (backend_e2e): install pytest and sh
Goffi <goffi@goffi.org>
parents: 3381
diff changeset
59 # we create the file sharing component which will autoconnect when backend is started
bcdfe7905409 docker (backend_e2e): install pytest and sh
Goffi <goffi@goffi.org>
parents: 3381
diff changeset
60 jp profile create file_sharing -j files.server1.test -p "" --xmpp-password test_e2e -C file_sharing -A && \
3497
73e04040d577 docker: update following name changes:
Goffi <goffi@goffi.org>
parents: 3439
diff changeset
61 libervia-backend stop
3427
f023f06fa344 docker (backend_e2e): added packages necessary to test Libervia + some debugging tools
Goffi <goffi@goffi.org>
parents: 3385
diff changeset
62
3497
73e04040d577 docker: update following name changes:
Goffi <goffi@goffi.org>
parents: 3439
diff changeset
63 ENV LIBERVIA_TEST_REPORT_DIR=/reports
3427
f023f06fa344 docker (backend_e2e): added packages necessary to test Libervia + some debugging tools
Goffi <goffi@goffi.org>
parents: 3385
diff changeset
64 ENV DISPLAY=:0
f023f06fa344 docker (backend_e2e): added packages necessary to test Libervia + some debugging tools
Goffi <goffi@goffi.org>
parents: 3385
diff changeset
65 USER root
f023f06fa344 docker (backend_e2e): added packages necessary to test Libervia + some debugging tools
Goffi <goffi@goffi.org>
parents: 3385
diff changeset
66 RUN apt-get install -y openbox
3497
73e04040d577 docker: update following name changes:
Goffi <goffi@goffi.org>
parents: 3439
diff changeset
67 USER libervia
3427
f023f06fa344 docker (backend_e2e): added packages necessary to test Libervia + some debugging tools
Goffi <goffi@goffi.org>
parents: 3385
diff changeset
68 EXPOSE 5900
3497
73e04040d577 docker: update following name changes:
Goffi <goffi@goffi.org>
parents: 3439
diff changeset
69
73e04040d577 docker: update following name changes:
Goffi <goffi@goffi.org>
parents: 3439
diff changeset
70 ENTRYPOINT ["/home/libervia/entrypoint_e2e.sh"]