-
Notifications
You must be signed in to change notification settings - Fork 5
/
Dockerfile
67 lines (60 loc) · 2.14 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
58
59
60
61
62
63
64
65
66
67
FROM ghcr.io/sdr-enthusiasts/docker-baseimage:base
ARG TARGETPLATFORM TARGETOS TARGETARCH
ENV BEASTPORT=30005 \
S6_BEHAVIOUR_IF_STAGE2_FAILS=2
COPY rootfs/ /
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# hadolint ignore=DL3008,SC2086,SC2039,SC2068
RUN set -x && \
TEMP_PACKAGES=() && \
KEPT_PACKAGES=() && \
# Deps for healthchecks
KEPT_PACKAGES+=(jq) && \
KEPT_PACKAGES+=(net-tools) && \
KEPT_PACKAGES+=(procps) && \
# Deps for pfclient
KEPT_PACKAGES+=(ca-certificates) && \
if [[ "${TARGETARCH}" == "arm64" ]]; then \
DOWNLOAD_URL="http://client.planefinder.net/pfclient_5.1.440_arm64.tar.gz"; \
DOWNLOAD_MD5SUM=fcba2b587d27442dddf5f18575222ca0; \
elif [[ "${TARGETARCH}" == "amd64" ]]; then \
DOWNLOAD_URL="http://client.planefinder.net/pfclient_5.0.162_amd64.tar.gz"; \
DOWNLOAD_MD5SUM=3bb9734b43e665b16a5a9ef4c43bfed3; \
else \
DOWNLOAD_URL="http://client.planefinder.net/pfclient_5.0.161_armhf.tar.gz"; \
DOWNLOAD_MD5SUM=0f1e6b90f292833060020d039b8d2fb1; \
fi && \
# pfclient install & healthchecks
KEPT_PACKAGES+=(curl) && \
# Install packages
apt-get update && \
apt-get install -y --no-install-recommends \
${KEPT_PACKAGES[@]} \
${TEMP_PACKAGES[@]} \
&& \
# Install pfclient
curl \
--location \
--output "/tmp/pfclient.tar.gz" \
"${DOWNLOAD_URL}" \
&& \
# Check md5sum
echo "${DOWNLOAD_MD5SUM} /tmp/pfclient.tar.gz" > /tmp/pfclient.md5sum && \
md5sum --check /tmp/pfclient.md5sum && \
# Extract pfclient
tar \
xvf "/tmp/pfclient.tar.gz" \
-C /usr/local/bin/ \
&& \
# Clean up
apt-get remove -y ${TEMP_PACKAGES[@]} && \
apt-get autoremove -q -o APT::Autoremove::RecommendsImportant=0 -o APT::Autoremove::SuggestsImportant=0 -y && \
apt-get clean -y && \
rm -rf /src /tmp/* /var/lib/apt/lists/* /git /var/cache/* && \
# Document version
echo "pfclient $(/usr/local/bin/pfclient --version | head -1 | rev | cut -d " " -f 1 | rev)" >> /VERSION && \
grep 'pfclient' /VERSION | cut -d ' ' -f2- > /CONTAINER_VERSION && \
cat /CONTAINER_VERSION
EXPOSE 30053/tcp 30054/tcp
# Add healthcheck
HEALTHCHECK --start-period=3600s --interval=600s CMD /scripts/healthcheck.sh