-
Notifications
You must be signed in to change notification settings - Fork 6
/
Dockerfile
57 lines (49 loc) · 1.77 KB
/
Dockerfile
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
# https://hub.docker.com/_/debian
FROM debian:bookworm-slim
ARG firefox_ver=133.0.3
ARG geckodriver_ver=0.35.0
ARG build_rev=0
RUN apt-get update \
&& apt-get upgrade -y \
&& apt-get install -y --no-install-recommends --no-install-suggests \
ca-certificates \
&& update-ca-certificates \
\
# Install tools for building
&& toolDeps=" \
curl bzip2 \
" \
&& apt-get install -y --no-install-recommends --no-install-suggests \
$toolDeps \
\
# Install dependencies for Firefox
&& apt-get install -y --no-install-recommends --no-install-suggests \
libgl1 libpci3 \
`apt-cache depends firefox-esr | awk '/Depends:/{print$2}'` \
\
# Download and install Firefox
&& curl -fL -o /tmp/firefox.tar.bz2 \
https://ftp.mozilla.org/pub/firefox/releases/${firefox_ver}/linux-x86_64/en-GB/firefox-${firefox_ver}.tar.bz2 \
&& tar -xjf /tmp/firefox.tar.bz2 -C /tmp/ \
&& mv /tmp/firefox /opt/firefox \
\
# Download and install geckodriver
&& curl -fL -o /tmp/geckodriver.tar.gz \
https://github.com/mozilla/geckodriver/releases/download/v${geckodriver_ver}/geckodriver-v${geckodriver_ver}-linux64.tar.gz \
&& tar -xzf /tmp/geckodriver.tar.gz -C /tmp/ \
&& chmod +x /tmp/geckodriver \
&& mv /tmp/geckodriver /usr/local/bin/ \
\
# Cleanup unnecessary stuff
&& apt-get purge -y --auto-remove \
-o APT::AutoRemove::RecommendsImportant=false \
$toolDeps \
&& rm -rf /var/lib/apt/lists/* \
/tmp/*
# As this image cannot run in non-headless mode anyway, it's better to forcibly
# enable it, regardless whether WebDriver client requests it in capabilities or
# not.
ENV MOZ_HEADLESS=1
EXPOSE 4444
ENTRYPOINT ["geckodriver"]
CMD ["--binary=/opt/firefox/firefox", "--log=debug"]