-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.in
47 lines (34 loc) · 1.49 KB
/
Dockerfile.in
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
FROM {ARG_FROM}
LABEL org.opencontainers.image.source "https://github.com/masudur-rahman/expense-tracker-bot"
ARG TARGETOS
ARG TARGETARCH
# When building, we can pass a unique value (e.g. `date +%s`) for this arg,
# which will force a rebuild from here (by invalidating docker's cache).
ARG FORCE_REBUILD=0
# When building, we can pass a hash of the licenses tree, which docker checks
# against its cache and can force a rebuild from here.
ARG HASH_LICENSES=0
# Add third-party licenses.
# COPY .licenses/ /LICENSES/
# When building, we can pass a hash of the binary, which docker checks against
# its cache and can force a rebuild from here.
ARG HASH_BINARY=0
ARG WKHTMLTOPDF_VERSION=0.12.6.1-2
RUN set -x \
&& apt-get update \
&& apt-get upgrade -y \
&& apt-get install -y --no-install-recommends ca-certificates wget \
&& echo 'Etc/UTC' > /etc/timezone
RUN set -x \
&& wget https://github.com/wkhtmltopdf/packaging/releases/download/${WKHTMLTOPDF_VERSION}/wkhtmltox_${WKHTMLTOPDF_VERSION}.bullseye_${TARGETARCH}.deb \
&& dpkg -i wkhtmltox_${WKHTMLTOPDF_VERSION}.bullseye_${TARGETARCH}.deb || true \
&& apt-get install -f -y \
&& ldconfig \
&& rm wkhtmltox_${WKHTMLTOPDF_VERSION}.bullseye_${TARGETARCH}.deb \
&& rm -rf /var/lib/apt/lists/* /usr/share/doc /usr/share/man /tmp/*
# Add the platform-specific binary.
COPY bin/{ARG_OS}_{ARG_ARCH}/{ARG_BIN} /{ARG_BIN}
# This would be nicer as `nobody:nobody` but distroless has no such entries.
USER 65535:65535
ENV HOME /
ENTRYPOINT ["/{ARG_BIN}"]