-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathDockerfile_fetcher
64 lines (51 loc) · 2.15 KB
/
Dockerfile_fetcher
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
# syntax=docker/dockerfile:1
# Taken from https://github.com/fernflower/trvalypobytexamchecker/blob/main/Dockerfile_fetcher
FROM ubuntu:focal
ARG DEBIAN_FRONTEND=noninteractive
RUN echo "===> Installing system dependencies..." && \
BUILD_DEPS="curl unzip" && \
apt-get update && apt-get install --no-install-recommends -y \
python3 python3-pip wget \
fonts-liberation libappindicator3-1 libasound2 libatk-bridge2.0-0 \
libnspr4 libnss3 lsb-release xdg-utils libxss1 libdbus-glib-1-2 libgbm1 \
# https://stackoverflow.com/questions/67090130/webdriverexception-process-unexpectedly-closed-with-status-255-selenium-ge
bzip2 libxtst6 libgtk-3-0 libx11-xcb-dev libxt6 libpci-dev \
$BUILD_DEPS \
xvfb && \
\
\
echo "===> Installing geckodriver and firefox..." && \
GECKODRIVER_VERSION=v0.32.2 && \
wget https://github.com/mozilla/geckodriver/releases/download/$GECKODRIVER_VERSION/geckodriver-$GECKODRIVER_VERSION-linux64.tar.gz && \
tar -zxf geckodriver-$GECKODRIVER_VERSION-linux64.tar.gz -C /usr/local/bin && \
chmod +x /usr/local/bin/geckodriver && \
rm geckodriver-$GECKODRIVER_VERSION-linux64.tar.gz && \
\
FIREFOX_SETUP=firefox-setup.tar.bz2 && \
apt-get purge firefox && \
wget -O $FIREFOX_SETUP "https://download.mozilla.org/?product=firefox-latest&os=linux64" && \
tar xjf $FIREFOX_SETUP -C /opt/ && \
ln -s /opt/firefox/firefox /usr/bin/firefox && \
rm $FIREFOX_SETUP && \
\
echo "===> Remove what is not needed anymore..." && \
rm -rf /var/lib/apt/lists/*
ENV LANG=C.UTF-8
ENV LC_ALL=C.UTF-8
ENV PYTHONUNBUFFERED=1
ENV PYTHONPATH=$PYTHONPATH:/code/src
ENV APP_HOME=/code
WORKDIR /$APP_HOME
COPY requirements-fetcher.txt requirements.txt
RUN pip install -r requirements.txt tox
COPY . $APP_HOME/
COPY tox-docker.ini tox.ini
ARG BASE_VERSION="v1.0.0"
ARG GIT_COMMIT="unknown"
ENV BASE_VERSION=$BASE_VERSION
ENV GIT_COMMIT=$GIT_COMMIT
LABEL org.opencontainers.image.title="Fetcher"
LABEL org.opencontainers.image.version=${BASE_VERSION}
LABEL org.opencontainers.image.revision=${GIT_COMMIT}
LABEL org.opencontainers.image.created="${BUILD_DATE}"
CMD ["python3", "-m", "fetcher"]