-
-
Notifications
You must be signed in to change notification settings - Fork 324
/
Dockerfile
53 lines (42 loc) · 1.24 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
# To build the image:
# docker build -t ghcr.io/go-rod/rod -f lib/docker/Dockerfile .
#
# build rod-manager
FROM golang as go
ARG goproxy="https://proxy.golang.org,direct"
COPY . /rod
WORKDIR /rod
RUN go env -w GOPROXY=$goproxy
RUN go build ./lib/launcher/rod-manager
RUN go run ./lib/utils/get-browser
FROM ubuntu:jammy
COPY --from=go /root/.cache/rod /root/.cache/rod
RUN ln -s /root/.cache/rod/browser/$(ls /root/.cache/rod/browser)/chrome /usr/bin/chrome
RUN touch /.dockerenv
COPY --from=go /rod/rod-manager /usr/bin/
ARG apt_sources="http://archive.ubuntu.com"
RUN sed -i "s|http://archive.ubuntu.com|$apt_sources|g" /etc/apt/sources.list && \
apt-get update > /dev/null && \
apt-get install --no-install-recommends -y \
# chromium dependencies
libnss3 \
libxss1 \
libasound2 \
libxtst6 \
libgtk-3-0 \
libgbm1 \
ca-certificates \
# fonts
fonts-liberation fonts-noto-color-emoji fonts-noto-cjk \
# timezone
tzdata \
# process reaper
dumb-init \
# headful mode support, for example: $ xvfb-run chromium-browser --remote-debugging-port=9222
xvfb \
> /dev/null && \
# cleanup
rm -rf /var/lib/apt/lists/*
# process reaper
ENTRYPOINT ["dumb-init", "--"]
CMD rod-manager