forked from DefectDojo/django-DefectDojo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.integration-tests-debian
79 lines (67 loc) · 2.94 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
# code: language=Dockerfile
FROM openapitools/openapi-generator-cli:v7.6.0@sha256:f86ca824293602b71b9b66683cc0011f8ff963858bd853621c554ff5cc7dd1d5 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
RUN \
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') && \
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
RUN \
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') && \
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"]