forked from fidelity/kconnect
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.deps
57 lines (46 loc) · 1.73 KB
/
Dockerfile.deps
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
FROM alpine:3.17 AS builder
ARG AWS_IAM_AUTH_VERSION=0.5.9
ARG ODIC_LOGIN_VERSION=1.28.0
ARG KUBELOGIN_VERSION=0.0.14
ARG KUBECTL_VERSION=1.22.11
ARG HELM_VERSION=3.9.0
ARG TARGETOS
ARG TARGETARCH
ARG TARGETVARIANT
RUN apk --no-cache add ca-certificates curl
# kubectl
RUN curl -LO "https://dl.k8s.io/release/v${KUBECTL_VERSION}/bin/${TARGETOS}/${TARGETARCH}/kubectl" && \
chmod +x ./kubectl
# aws-iam-authenticator
RUN curl -L \
https://github.com/kubernetes-sigs/aws-iam-authenticator/releases/download/v${AWS_IAM_AUTH_VERSION}/aws-iam-authenticator_${AWS_IAM_AUTH_VERSION}_${TARGETOS}_${TARGETARCH} -o aws-iam-authenticator && \
chmod +x ./aws-iam-authenticator
# oidclogin
RUN curl -L \
https://github.com/int128/kubelogin/releases/download/v${ODIC_LOGIN_VERSION}/kubelogin_${TARGETOS}_${TARGETARCH}.zip -o oidclogin.zip && \
unzip oidclogin.zip && \
mv kubelogin kubectl-oidc_login && \
chmod +x ./kubectl-oidc_login
# kubelogin
RUN curl -L \
https://github.com/Azure/kubelogin/releases/download/v${KUBELOGIN_VERSION}/kubelogin-${TARGETOS}-${TARGETARCH}.zip -o kubelogin.zip && \
unzip kubelogin.zip
# Helm
RUN curl -L https://get.helm.sh/helm-v${HELM_VERSION}-${TARGETOS}-${TARGETARCH}.tar.gz -o helm.tar.gz && \
tar xvfz helm.tar.gz
FROM mcr.microsoft.com/azure-cli:2.48.1
RUN apk --no-cache add ca-certificates
WORKDIR /app/
ENV PATH="/app:${PATH}"
ARG TARGETOS
ARG TARGETARCH
ARG TARGETVARIANT
COPY --from=builder kubectl .
COPY --from=builder aws-iam-authenticator .
COPY --from=builder kubectl-oidc_login .
COPY --from=builder bin/${TARGETOS}_${TARGETARCH}/kubelogin .
COPY --from=builder ${TARGETOS}-${TARGETARCH}/helm .
COPY kconnect .
RUN adduser -D kconnect
USER kconnect
ENTRYPOINT ["/app/kconnect"]