-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathDockerfile-0.12.6.1
43 lines (36 loc) · 1.15 KB
/
Dockerfile-0.12.6.1
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
# first stage: build kwkhtmltopdf_server
FROM --platform=linux/amd64 docker.io/golang:1.23.3
WORKDIR /tmp
COPY server/kwkhtmltopdf_server.go .
RUN go build kwkhtmltopdf_server.go
# second stage: server with wkhtmltopdf
FROM --platform=linux/amd64 docker.io/ubuntu:22.04
RUN set -x \
&& apt update \
&& apt -y install --no-install-recommends \
wget \
ca-certificates \
fonts-liberation2 \
fontconfig \
libjpeg-turbo8 \
libx11-6 \
libxext6 \
libxrender1 \
xfonts-75dpi \
xfonts-base \
fonts-lato \
&& wget -q -O /tmp/wkhtmltox.deb https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6.1-2/wkhtmltox_0.12.6.1-2.jammy_amd64.deb \
&& echo "800eb1c699d07238fee77bf9df1556964f00ffcf /tmp/wkhtmltox.deb" | sha1sum -c - \
&& dpkg -i /tmp/wkhtmltox.deb \
&& apt -f install \
&& apt -y purge wget --autoremove \
&& apt -y clean \
&& rm -rf /var/lib/apt/lists/* \
&& rm /tmp/wkhtmltox.deb
COPY --from=0 /tmp/kwkhtmltopdf_server /usr/local/bin/
RUN adduser --disabled-password --gecos '' kwkhtmltopdf
USER kwkhtmltopdf
ENV LANG=C.UTF-8
ENV LC_ALL=C.UTF-8
EXPOSE 8080
CMD ["/usr/local/bin/kwkhtmltopdf_server"]