From 6c0a535831ddead2c62a13c91bd74e3ae5f00f60 Mon Sep 17 00:00:00 2001 From: Nikolai Rodionov Date: Mon, 6 Feb 2023 22:19:43 +0100 Subject: [PATCH] Create a dockerfiles for base a helmfile --- Dockerfile | 1 - Dockerfile-helmfile | 16 ---------------- dockerfiles/Dockerfile-helmfile | 30 +++++++++++++++--------------- 3 files changed, 15 insertions(+), 32 deletions(-) delete mode 100644 Dockerfile-helmfile diff --git a/Dockerfile b/Dockerfile index 5a441c6..0587e3d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,6 @@ RUN apk update && apk add --no-cache gcc musl-dev COPY ./ . RUN cargo build --release - FROM alpine:3.17.1 COPY --from=builder /src/target/release/cdh /bin/cdh WORKDIR /workdir diff --git a/Dockerfile-helmfile b/Dockerfile-helmfile deleted file mode 100644 index 8ab352c..0000000 --- a/Dockerfile-helmfile +++ /dev/null @@ -1,16 +0,0 @@ -FROM alpine:3.17.1 -ARG HELM_VERSION=3.10.3 -ARG HELMFILE_VERSION=0.150.0 - -ARG HELM_LINK=https://get.helm.sh/helm-v$HELM_VERSION-linux-$PLATFORM.tar.gz -ARG HELMFILE_LINK=https://github.com/helmfile/helmfile/releases/download/v$HELMFILE_VERSION/helmfile_$HELMFILE_VERSION_linux_\$PLATFORM.tar.gz - -RUN apk update && apk add --no-cache curl -COPY ./scripts /tmp -RUN echo "installing helm from ${HELM_LINK}" -ENV HELM_ARCHIVE_PATH=/tmp/helm.tar.gz -RUN /tmp/download_for_arch.sh $HELM_LINK $HELM_ARCHIVE_PATH -RUN tar -zxvf $HELM_ARCHIVE_PATH -RUN echo $HELMFILE_LINK - -CMD ["sh"] diff --git a/dockerfiles/Dockerfile-helmfile b/dockerfiles/Dockerfile-helmfile index 5995d67..f3dfb32 100644 --- a/dockerfiles/Dockerfile-helmfile +++ b/dockerfiles/Dockerfile-helmfile @@ -1,16 +1,16 @@ -FROM alpine:3.17.1 -ARG HELM_VERSION=3.10.3 -ARG HELMFILE_VERSION=0.150.0 +FROM ghcr.io/allanger/clever-install as builder +RUN apk update && apk add tar +ARG HELM_VERSION=v3.10.3 +ARG HELMFILE_VERSION=v0.144.0 +ENV RUST_LOG=info +RUN clin -l "https://github.com/roboll/helmfile/releases/download/{{ version }}/helmfile_{{ os }}_{{ arch }}" -i /tmp/helmfile -p $HELMFILE_VERSION +RUN clin -l "https://get.helm.sh/helm-{{ version }}-{{ os }}-{{ arch }}.tar.gz" -i /tmp/helm.tar.gz -p $HELM_VERSION +RUN tar -xf /tmp/helm.tar.gz -C /tmp && rm -f /tmp/helm.tar.gz +RUN mkdir /out && for bin in `find /tmp | grep helm`; do cp $bin /out/; done +RUN chmod +x /out/helm +RUN chmod +x /out/helmfile -ARG HELM_LINK=https://get.helm.sh/helm-v$HELM_VERSION-linux-\$PLATFORM.tar.gz -ARG HELMFILE_LINK=https://github.com/helmfile/helmfile/releases/download/v$HELMFILE_VERSION/helmfile_$HELMFILE_VERSION_linux_\$PLATFORM.tar.gz - -RUN apk update && apk add --no-cache curl - -RUN echo "installing helm from ${HELM_LINK}" -ENV HELM_ARCHIVE_PATH=/tmp/helm.tar.gz -RUN curl -LJO $HELM $HELM_ARCHIVE_PATH -RUN tar -zxvf $HELM_ARCHIVE_PATH -RUN echo $HELMFILE_LINK - -CMD ["sh"] +FROM check-da-helm-base +COPY --from=builder /out/ /usr/bin +RUN apk update --no-cache && apk add --no-cache jq bash +ENTRYPOINT ["cdh"]