|
| 1 | +FROM golang:1.16.3-buster as builder |
| 2 | + |
| 3 | +RUN apt update -qq && \ |
| 4 | + apt install --no-install-recommends -y make git && \ |
| 5 | + rm -rf /var/lib/apt/lists/* |
| 6 | +WORKDIR /workspace/helmfile |
| 7 | +COPY . /workspace/helmfile |
| 8 | +RUN make static-linux |
| 9 | + |
| 10 | +# ----------------------------------------------------------------------------- |
| 11 | + |
| 12 | +FROM ubuntu:20.10 |
| 13 | + |
| 14 | +RUN apt update -qq && \ |
| 15 | + apt install --no-install-recommends -y \ |
| 16 | + ca-certificates \ |
| 17 | + git bash curl jq pip wget && \ |
| 18 | + rm -rf /var/lib/apt/lists/* |
| 19 | + |
| 20 | +ARG HELM_VERSION="v3.5.3" |
| 21 | +ARG HELM_LOCATION="https://get.helm.sh" |
| 22 | +ARG HELM_FILENAME="helm-${HELM_VERSION}-linux-amd64.tar.gz" |
| 23 | +ARG HELM_SHA256="2170a1a644a9e0b863f00c17b761ce33d4323da64fc74562a3a6df2abbf6cd70" |
| 24 | +RUN set -x && \ |
| 25 | + wget ${HELM_LOCATION}/${HELM_FILENAME} && \ |
| 26 | + echo Verifying ${HELM_FILENAME}... && \ |
| 27 | + sha256sum ${HELM_FILENAME} | grep -q "${HELM_SHA256}" && \ |
| 28 | + echo Extracting ${HELM_FILENAME}... && \ |
| 29 | + tar zxvf ${HELM_FILENAME} && mv /linux-amd64/helm /usr/local/bin/ && \ |
| 30 | + rm ${HELM_FILENAME} && rm -r /linux-amd64 |
| 31 | + |
| 32 | +# using the install documentation found at https://kubernetes.io/docs/tasks/tools/install-kubectl/ |
| 33 | +# for now but in a future version of alpine (in the testing version at the time of writing) |
| 34 | +# we should be able to install using apk add. |
| 35 | +# the sha256 sum can be found at https://storage.googleapis.com/kubernetes-release/release/${KUBECTL_VERSION}/bin/linux/amd64/kubectl.sha256 |
| 36 | +# maybe a good idea to automate in the future? |
| 37 | +ENV KUBECTL_VERSION="v1.18.9" |
| 38 | +ENV KUBECTL_SHA256="6a68756a2d3d04b4d0f52b00de6493ba2c1fcb28b32f3e4a0e99b3d9f6c4e8ed" |
| 39 | +RUN set -x && \ |
| 40 | + curl --retry 5 --retry-connrefused -LO "https://storage.googleapis.com/kubernetes-release/release/${KUBECTL_VERSION}/bin/linux/amd64/kubectl" && \ |
| 41 | + sha256sum kubectl | grep ${KUBECTL_SHA256} && \ |
| 42 | + chmod +x kubectl && \ |
| 43 | + mv kubectl /usr/local/bin/kubectl |
| 44 | + |
| 45 | +ENV KUSTOMIZE_VERSION="v3.8.8" |
| 46 | +ENV KUSTOMIZE_SHA256="175938206f23956ec18dac3da0816ea5b5b485a8493a839da278faac82e3c303" |
| 47 | +RUN set -x && \ |
| 48 | + curl --retry 5 --retry-connrefused -LO https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize/${KUSTOMIZE_VERSION}/kustomize_${KUSTOMIZE_VERSION}_linux_amd64.tar.gz && \ |
| 49 | + sha256sum kustomize_${KUSTOMIZE_VERSION}_linux_amd64.tar.gz | grep ${KUSTOMIZE_SHA256} && \ |
| 50 | + tar zxf kustomize_${KUSTOMIZE_VERSION}_linux_amd64.tar.gz && \ |
| 51 | + rm kustomize_${KUSTOMIZE_VERSION}_linux_amd64.tar.gz && \ |
| 52 | + mv kustomize /usr/local/bin/kustomize |
| 53 | + |
| 54 | +RUN pip install sops |
| 55 | + |
| 56 | +RUN helm plugin install https://github.com/databus23/helm-diff --version v3.1.3 && \ |
| 57 | + helm plugin install https://github.com/jkroepke/helm-secrets --version v3.5.0 && \ |
| 58 | + helm plugin install https://github.com/hypnoglow/helm-s3.git --version v0.10.0 && \ |
| 59 | + helm plugin install https://github.com/aslafy-z/helm-git.git --version v0.10.0 |
| 60 | + |
| 61 | +COPY --from=builder /workspace/helmfile/dist/helmfile_linux_amd64 /usr/local/bin/helmfile |
| 62 | + |
| 63 | +CMD ["/usr/local/bin/helmfile"] |
0 commit comments