forked from Profirator/api-umbrella
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Dockerfile-test
42 lines (34 loc) · 1.86 KB
/
Dockerfile-test
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
ARG BASE_IMAGE=fiware/api-umbrella-base:latest
FROM ${BASE_IMAGE} AS build
WORKDIR /app
ENV INSTALL_TEST_DEPENDENCIES=true
RUN apt-get install -y wget
RUN apt-get install -y gnupg
RUN wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | apt-key add -
# install chrome for selenium tests
RUN set -x && \
apt-get update && \
curl --silent --show-error --location --fail --retry 3 --output /tmp/google-chrome-stable_current_amd64.deb https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb && \
(dpkg -i /tmp/google-chrome-stable_current_amd64.deb || apt-get -fy install) && \
rm -f /tmp/google-chrome-stable_current_amd64.deb && \
sed -i 's|HERE/chrome"|HERE/chrome" --disable-setuid-sandbox --no-sandbox|g' /opt/google/chrome/google-chrome && \
google-chrome --version
RUN set -x && \
CHROME_VERSION="$(google-chrome --version)" && \
export CHROMEDRIVER_RELEASE="$(echo $CHROME_VERSION | sed 's/^Google Chrome //')" && export CHROMEDRIVER_RELEASE=${CHROMEDRIVER_RELEASE%%.*} && \
CHROMEDRIVER_VERSION=$(curl --location --fail --retry 3 http://chromedriver.storage.googleapis.com/LATEST_RELEASE_${CHROMEDRIVER_RELEASE}) && \
curl --silent --show-error --location --fail --retry 3 --output /tmp/chromedriver_linux64.zip "http://chromedriver.storage.googleapis.com/$CHROMEDRIVER_VERSION/chromedriver_linux64.zip" && \
cd /tmp && \
unzip chromedriver_linux64.zip && \
rm -rf chromedriver_linux64.zip && \
mv chromedriver /usr/local/bin/chromedriver && \
chmod +x /usr/local/bin/chromedriver && \
chromedriver --version
RUN groupadd -r api-umbrella && \
useradd -r -g api-umbrella -s /sbin/nologin -d /opt/api-umbrella -c "API Umbrella user" api-umbrella
RUN /app/tasks/install-system-build-dependencies
RUN make test-deps
COPY test /app/test
COPY Gemfile /app/Gemfile
COPY Gemfile.lock /app/Gemfile.lock
COPY config/test.yml config/test.yml