-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
60 lines (48 loc) · 2.1 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
FROM alpine:3.15
ARG TARGETPLATFORM
ARG BUILDPLATFORM
RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM"
RUN apk add --no-cache ca-certificates
# When $TARGETPLATFORM is linux/arm/v7, strip out the '/v6' or '/v7' from it
RUN set -eux; \
BIN_URL=https://dl.k8s.io/release/v1.29.12/bin/$( echo $TARGETPLATFORM | sed 's@/v[67]$@@' )/kubectl; \
SHA512=$( wget -qO- "$BIN_URL.sha512" ); \
wget -qO- "$BIN_URL" > /usr/local/bin/kubectl; \
chmod +x /usr/local/bin/kubectl; \
sha512sum /usr/local/bin/kubectl | grep "^$SHA512 "; \
kubectl version --client
# From: https://github.com/nginxinc/docker-nginx/blob/1.17.0/stable/alpine/Dockerfile
# Bring in gettext so we can get `envsubst`, then throw
# the rest away. To do this, we need to install `gettext`
# then move `envsubst` out of the way so `gettext` can
# be deleted completely, then move `envsubst` back.
RUN apk add --no-cache --virtual .gettext gettext \
&& mv /usr/bin/envsubst /tmp/ \
\
&& runDeps="$( \
scanelf --needed --nobanner /tmp/envsubst \
| awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \
| sort -u \
| xargs -r apk info --installed \
| sort -u \
)" \
&& apk add --no-cache $runDeps \
&& apk del .gettext \
&& mv /tmp/envsubst /usr/local/bin/
RUN apk add --no-cache git
RUN apk add --no-cache jq
RUN apk add --no-cache curl \
&& curl -L https://github.com/kubernetes-sigs/kustomize/releases/download/v2.0.3/kustomize_2.0.3_linux_amd64 -o /usr/local/bin/kustomize \
&& chmod +x /usr/local/bin/kustomize \
&& apk del curl
RUN set -eux; \
wget -qO- https://github.com/mozilla/sops/releases/download/v3.7.3/sops-v3.7.3.linux > /usr/local/bin/sops; \
chmod +x /usr/local/bin/sops; \
sha256sum /usr/local/bin/sops | grep '^53aec65e45f62a769ff24b7e5384f0c82d62668dd96ed56685f649da114b4dbb '; \
sops --version
RUN apk add --no-cache gnupg
RUN apk add --no-cache openssh-client
RUN apk add --no-cache yq
COPY docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x /docker-entrypoint.sh
ENTRYPOINT [ "/docker-entrypoint.sh" ]