Skip to content

Commit 787e6c8

Browse files
vseryozhenkoValera Seryozhenko
and
Valera Seryozhenko
authored
ubuntu docker based image for helmfile (roboll#1863)
Co-authored-by: Valera Seryozhenko <[email protected]>
1 parent 724b4b3 commit 787e6c8

File tree

2 files changed

+120
-0
lines changed

2 files changed

+120
-0
lines changed

Dockerfile.helm3.ubuntu

+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
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"]

Dockerfile.ubuntu

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
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="v2.17.0"
21+
ARG HELM_LOCATION="https://kubernetes-helm.storage.googleapis.com"
22+
ARG HELM_FILENAME="helm-${HELM_VERSION}-linux-amd64.tar.gz"
23+
ARG HELM_SHA256="f3bec3c7c55f6a9eb9e6586b8c503f370af92fe987fcbf741f37707606d70296"
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+
mv /linux-amd64/tiller /usr/local/bin/ && \
31+
rm ${HELM_FILENAME} && rm -r /linux-amd64
32+
33+
# using the install documentation found at https://kubernetes.io/docs/tasks/tools/install-kubectl/
34+
# for now but in a future version of alpine (in the testing version at the time of writing)
35+
# we should be able to install using apk add.
36+
# the sha256 sum can be found at https://storage.googleapis.com/kubernetes-release/release/${KUBECTL_VERSION}/bin/linux/amd64/kubectl.sha256
37+
# maybe a good idea to automate in the future?
38+
ENV KUBECTL_VERSION="v1.18.9"
39+
ENV KUBECTL_SHA256="6a68756a2d3d04b4d0f52b00de6493ba2c1fcb28b32f3e4a0e99b3d9f6c4e8ed"
40+
RUN set -x & \
41+
curl --retry 5 --retry-connrefused -LO "https://storage.googleapis.com/kubernetes-release/release/${KUBECTL_VERSION}/bin/linux/amd64/kubectl" && \
42+
sha256sum kubectl | grep ${KUBECTL_SHA256} && \
43+
chmod +x kubectl && \
44+
mv kubectl /usr/local/bin/kubectl
45+
46+
RUN pip install sops
47+
48+
RUN ["helm", "init", "--client-only", "--stable-repo-url", "https://charts.helm.sh/stable"]
49+
RUN helm plugin install https://github.com/databus23/helm-diff && \
50+
helm plugin install https://github.com/futuresimple/helm-secrets && \
51+
helm plugin install https://github.com/hypnoglow/helm-s3.git && \
52+
helm plugin install https://github.com/aslafy-z/helm-git.git && \
53+
helm plugin install https://github.com/rimusz/helm-tiller
54+
55+
COPY --from=builder /workspace/helmfile/dist/helmfile_linux_amd64 /usr/local/bin/helmfile
56+
57+
CMD ["/usr/local/bin/helmfile", "--help"]

0 commit comments

Comments
 (0)