Skip to content
Merged
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
24 changes: 23 additions & 1 deletion tooler/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
FROM mozilla/sops:v3-alpine AS sops

# from https://stackoverflow.com/questions/60298619/awscli-version-2-on-alpine-linux
FROM python:3.10.5-alpine as aws_builder

ARG AWS_CLI_VERSION=2.7.20
RUN apk add --no-cache git unzip groff build-base libffi-dev cmake
RUN git clone --single-branch --depth 1 -b ${AWS_CLI_VERSION} https://github.com/aws/aws-cli.git

WORKDIR aws-cli
RUN sed -i'' 's/PyInstaller.*/PyInstaller==5.2/g' requirements-build.txt
RUN python -m venv venv
RUN . venv/bin/activate
RUN scripts/installers/make-exe
RUN unzip -q dist/awscli-exe.zip
RUN aws/install --bin-dir /aws-cli-bin
RUN /aws-cli-bin/aws --version

# reduce image size: remove autocomplete and examples
RUN rm -rf /usr/local/aws-cli/v2/current/dist/aws_completer /usr/local/aws-cli/v2/current/dist/awscli/data/ac.index /usr/local/aws-cli/v2/current/dist/awscli/examples
RUN find /usr/local/aws-cli/v2/current/dist/awscli/botocore/data -name examples-1.json -delete

FROM alpine
LABEL maintainer="Schille"

Expand All @@ -13,14 +33,16 @@ ARG KUBESEAL_VERSION=v0.15.0
# ENV BASE_URL="https://storage.googleapis.com/kubernetes-helm"
ENV BASE_URL="https://get.helm.sh"
ENV TAR_FILE="helm-v${HELM_VERSION}-linux-${TARGETARCH}.tar.gz"
RUN apk add --update --no-cache curl ca-certificates tar bash git gnupg aws-cli && \
RUN apk add --update --no-cache curl ca-certificates tar bash git gnupg && \
curl -sL ${BASE_URL}/${TAR_FILE} | tar -xvz && \
mv linux-${TARGETARCH}/helm /usr/bin/helm && \
chmod +x /usr/bin/helm && \
rm -rf linux-${TARGETARCH}

ENV HELM_DATA_HOME=/usr/local/share/helm

COPY --from=aws_builder /usr/local/aws-cli/ /usr/local/aws-cli/
COPY --from=aws_builder /aws-cli-bin/ /usr/local/bin/
COPY --from=sops /usr/local/bin/sops /bin/sops


Expand Down