| 1 |
ARG REVISION |
| 2 |
FROM libervia/backend:${REVISION:-dev} |
| 3 |
|
| 4 |
LABEL maintainer="Goffi <[email protected]>" |
| 5 |
|
| 6 |
USER root |
| 7 |
|
| 8 |
ARG DEBIAN_FRONTEND=noninteractive |
| 9 |
|
| 10 |
RUN mkdir -m 777 /reports && \ |
| 11 |
apt-get install -y --no-install-recommends \ |
| 12 |
# firefox is needed to test Libervia via selenium |
| 13 |
firefox-esr \ |
| 14 |
# VNC/X11 server for visual mode + window manager |
| 15 |
# using openbox as it allows to resize easily when doing manual debugging/tests |
| 16 |
# and it adapts correctly when doing driver.set_window_size |
| 17 |
tigervnc-standalone-server openbox \ |
| 18 |
# useful for remote debugging |
| 19 |
telnet net-tools \ |
| 20 |
# needed to make Firefox trust system certificates |
| 21 |
# cf. https://askubuntu.com/a/1036637 |
| 22 |
p11-kit \ |
| 23 |
# GStreamer, used to test WebRTC stack |
| 24 |
libgstreamer1.0-0 \ |
| 25 |
gstreamer1.0-plugins-base \ |
| 26 |
gstreamer1.0-plugins-good \ |
| 27 |
gstreamer1.0-plugins-bad \ |
| 28 |
gstreamer1.0-nice \ |
| 29 |
gir1.2-gstreamer-1.0 \ |
| 30 |
gir1.2-gst-plugins-bad-1.0 \ |
| 31 |
python3-gst-1.0 && \ |
| 32 |
ln -fs /usr/lib/x86_64-linux-gnu/pkcs11/p11-kit-trust.so /usr/lib/firefox-esr/libnssckbi.so |
| 33 |
|
| 34 |
# we install pre-generated certificates so we can do tests with valid TLS |
| 35 |
COPY --chown=root:root certificates/minica.pem /usr/local/share/ca-certificates/minica.crt |
| 36 |
COPY --chown=root:tls-cert certificates/server1.test/cert.pem /usr/share/libervia/certificates/server1.test.pem |
| 37 |
COPY --chown=root:tls-cert certificates/server1.test/key.pem /usr/share/libervia/certificates/server1.test-key.pem |
| 38 |
RUN update-ca-certificates |
| 39 |
|
| 40 |
COPY --chown=root:root libervia.conf /etc/libervia.conf |
| 41 |
COPY --chown=libervia:libervia scripts/entrypoint.sh /home/libervia/entrypoint_e2e.sh |
| 42 |
|
| 43 |
RUN \ |
| 44 |
# we install webdriver (needed to control Firefox from Selenium) |
| 45 |
# note: this is not absolutely necessary as long as we use helium because it includes |
| 46 |
# is own webdriver |
| 47 |
python -c 'from urllib.request import urlretrieve;\ |
| 48 |
urlretrieve(\ |
| 49 |
"https://github.com/mozilla/geckodriver/releases/download/v0.34.0"\ |
| 50 |
"/geckodriver-v0.34.0-linux64.tar.gz", "/usr/local/bin/geckodriver.tar.gz")' && \ |
| 51 |
cd /usr/local/bin && tar zxf geckodriver.tar.gz && rm -f geckodriver.tar.gz |
| 52 |
|
| 53 |
WORKDIR /home/libervia |
| 54 |
USER libervia |
| 55 |
|
| 56 |
RUN \ |
| 57 |
# pytest and its plugins |
| 58 |
pip install pytest pytest-timeout pytest-dependency pytest-twisted \ |
| 59 |
# needed to test libervia-cli |
| 60 |
sh \ |
| 61 |
# needed to test libervia |
| 62 |
helium \ |
| 63 |
# needed to check sent emails |
| 64 |
aiosmtpd \ |
| 65 |
# useful for debugging |
| 66 |
pudb |
| 67 |
|
| 68 |
RUN ./entrypoint.sh \ |
| 69 |
# we create the file sharing component which will autoconnect when backend is started |
| 70 |
li profile create file-sharing -j files.server1.test -p "" --xmpp-password test_e2e -C file-sharing -A && \ |
| 71 |
libervia-backend stop |
| 72 |
|
| 73 |
ENV LIBERVIA_TEST_REPORT_DIR=/reports |
| 74 |
ENV DISPLAY=:0 |
| 75 |
USER root |
| 76 |
RUN apt-get install -y openbox |
| 77 |
USER libervia |
| 78 |
EXPOSE 5900 |
| 79 |
|
| 80 |
ENTRYPOINT ["/home/libervia/entrypoint_e2e.sh"] |