-
Notifications
You must be signed in to change notification settings - Fork 1.6k
/
Dockerfile.integration-tests-debian
88 lines (73 loc) · 3.44 KB
/
Dockerfile.integration-tests-debian
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
# code: language=Dockerfile
FROM openapitools/openapi-generator-cli:v7.10.0@sha256:f2054a5a7908ad81017d0f0839514ba5eab06ae628914ff71554d46fac1bcf7a AS openapitools
FROM python:3.11.9-slim-bookworm@sha256:8c1036ec919826052306dfb5286e4753ffd9d5f6c24fbc352a5399c3b405b57e AS build
WORKDIR /app
RUN \
apt-get -y update && \
apt-get -y install \
git \
wget \
curl \
unzip \
gpg \
default-jre-headless \
jq \
apt-file \
libnss3 \
xvfb \
&& \
apt-get clean && \
true
RUN pip install --no-cache-dir selenium==4.9.0 requests
# Install the latest Google Chrome stable release
WORKDIR /opt/chrome
# TODO: figure out whatever fix is necessary to use Chrome >= 128 and put this back in the RUN below so we stay
# up-to-date
# chrome_url=$(curl https://googlechromelabs.github.io/chrome-for-testing/last-known-good-versions-with-downloads.json | jq -r '.channels[] | select(.channel == "Stable") | .downloads.chrome[] | select(.platform == "linux64").url') && \
RUN \
chrome_url="https://storage.googleapis.com/chrome-for-testing-public/127.0.6533.119/linux64/chrome-linux64.zip" && \
wget $chrome_url && \
unzip chrome-linux64.zip && \
rm -rf chrome-linux64.zip && \
chmod -R 0755 . && \
ln -s /opt/chrome/chrome-linux64/chrome /usr/bin/chrome
# Install the dependencies for Google Chrome
RUN apt-file update
COPY docker/install_chrome_dependencies.py install_chrome_dependencies.py
RUN \
missing_chrome_deps=$(python install_chrome_dependencies.py) && \
apt-get -y install $missing_chrome_deps
# Install a suggested list of additional packages (https://stackoverflow.com/a/76734752)
RUN apt-get install -y libxi6 libgconf-2-4 jq libjq1 libonig5 libxkbcommon0 libxss1 libglib2.0-0 libnss3 \
libfontconfig1 libatk-bridge2.0-0 libatspi2.0-0 libgtk-3-0 libpango-1.0-0 libgdk-pixbuf2.0-0 libxcomposite1 \
libxcursor1 libxdamage1 libxtst6 libappindicator3-1 libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libxfixes3 \
libdbus-1-3 libexpat1 libgcc1 libnspr4 libgbm1 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxext6 \
libxrandr2 libxrender1 gconf-service ca-certificates fonts-liberation libappindicator1 lsb-release xdg-utils
# Installing the latest stable Google Chrome driver release
WORKDIR /opt/chrome-driver
# TODO: figure out whatever fix is necessary to use Chrome >= 128 and put this back in the RUN below so we stay
# up-to-date
# chromedriver_url=$(curl https://googlechromelabs.github.io/chrome-for-testing/last-known-good-versions-with-downloads.json | jq -r '.channels[] | select(.channel == "Stable") | .downloads.chromedriver[] | select(.platform == "linux64").url') && \
RUN \
chromedriver_url="https://storage.googleapis.com/chrome-for-testing-public/127.0.6533.119/linux64/chromedriver-linux64.zip" && \
wget $chromedriver_url && \
unzip -j chromedriver-linux64.zip chromedriver-linux64/chromedriver && \
rm -rf chromedriver-linux64.zip && \
chmod -R 0755 .
WORKDIR /app
# install openapi-generator-cli
COPY --from=openapitools /opt/openapi-generator/modules/openapi-generator-cli/target/openapi-generator-cli.jar /usr/local/bin/openapi-generator-cli.jar
COPY docker/wait-for-it.sh \
docker/secret-file-loader.sh \
docker/reach_database.sh \
docker/entrypoint-integration-tests.sh \
/
COPY tests/ ./tests/
RUN chmod -R 0777 /app
ARG uid=1001
USER ${uid}
ENV \
DD_ADMIN_USER=admin \
DD_ADMIN_PASSWORD='' \
DD_BASE_URL="http://localhost:8080/"
CMD ["/entrypoint-integration-tests.sh"]