-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
39 lines (33 loc) · 944 Bytes
/
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
FROM alpine:edge as downloader
RUN set -eux; \
apk add --no-cache \
ca-certificates \
curl \
;
WORKDIR /work
ARG TARGETARCH
RUN set -eux; \
case "$TARGETARCH" in \
arm/v7) \
ARCH="arm"; \
;; \
*) \
ARCH="$TARGETARCH"; \
;; \
esac; \
BASE_URL="https://github.com/backplane/ghlatest"; \
LATEST_URL=$(curl -sS -w "%{redirect_url}\n" "${BASE_URL}/releases/latest"); \
LATEST_TAG="${LATEST_URL##*/v}"; \
DL_URL="${BASE_URL}/releases/download/v${LATEST_TAG}/ghlatest_${LATEST_TAG}_linux_${ARCH}.tar.gz"; \
TAR="ghlatest.tgz"; \
curl -sSL -o "$TAR" "$DL_URL"; \
tar -xvzf "$TAR" ghlatest; \
rm -- "$TAR";
FROM busybox:musl
LABEL maintainer="Backplane BV <[email protected]>"
COPY shortarch.sh /bin/shortarch
COPY --from=downloader /work/ghlatest /bin/
COPY --from=downloader /etc/ssl/certs /etc/ssl/certs
USER 65534:65534
WORKDIR /work
ENTRYPOINT ["/bin/ghlatest"]