Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 20 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
FROM alpine:latest
RUN adduser kustomize -D \
&& apk add curl git openssh \
&& git config --global url.ssh://git@github.com/.insteadOf https://github.com/
RUN curl -L --output /tmp/kustomize_v3.3.0_linux_amd64.tar.gz https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize%2Fv3.3.0/kustomize_v3.3.0_linux_amd64.tar.gz \
&& echo "4b49e1bbdb09851f11bb81081bfffddc7d4ad5f99b4be7ef378f6e3cf98d42b6 /tmp/kustomize_v3.3.0_linux_amd64.tar.gz" | sha256sum -c \
&& tar -xvzf /tmp/kustomize_v3.3.0_linux_amd64.tar.gz -C /usr/local/bin \
&& chmod +x /usr/local/bin/kustomize \
&& mkdir ~/.ssh \
&& ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts
USER kustomize
FROM alpine:3.19 AS DEPENDENCIES

WORKDIR /downloads

RUN apk add curl && \
curl --location --silent --output kustomize_v5.4.1_linux_amd64.tar.gz https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize%2Fv5.4.1/kustomize_v5.4.1_linux_amd64.tar.gz && \
echo "3d659a80398658d4fec4ec4ca184b432afa1d86451a60be63ca6e14311fc1c42 kustomize_v5.4.1_linux_amd64.tar.gz" | sha256sum -c && \
tar -xzf kustomize_v5.4.1_linux_amd64.tar.gz

FROM alpine:3.19

WORKDIR /src

RUN apk add git openssh && \
git config --global url.ssh://git@github.com/.insteadOf https://github.com/ && \
mkdir ~/.ssh && \
ssh-keyscan github.com >> /etc/ssh/ssh_known_hosts

COPY --from=DEPENDENCIES /downloads/kustomize /usr/local/bin/

USER nobody