diff --git a/Dockerfile b/Dockerfile index 6e4b1f1..60b1243 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,21 +1,24 @@ ARG HELM_VERSION -ARG S3_PLUGIN_VERSION -ARG GCS_PLUGIN_VERSION -ARG PUSH_PLUGIN_VERSION +ARG KUBE_VERSION="v1.14.3" +ARG ALPINE_VERSION=3.11 +ARG PYTHON_VERSION=3.8 +# SETUP FROM golang:latest as setup ARG HELM_VERSION -ARG S3_PLUGIN_VERSION -ARG GCS_PLUGIN_VERSION -ARG PUSH_PLUGIN_VERSION -RUN echo "HELM_VERSION is set to: ${HELM_VERSION}" && mkdir /temp -RUN curl -L "https://get.helm.sh/helm-v${HELM_VERSION}-linux-amd64.tar.gz" -o helm.tar.gz \ +ENV HELM_VERSION ${HELM_VERSION} +ARG KUBE_VERSION +RUN echo "HELM_VERSION is set to: ${HELM_VERSION}" +RUN apt update && apt install -y bash \ + && curl -L "https://get.helm.sh/helm-v${HELM_VERSION}-linux-amd64.tar.gz" -o helm.tar.gz \ && tar -zxvf helm.tar.gz \ && mv ./linux-amd64/helm /usr/local/bin/helm \ - && bash -c 'if [[ "${HELM_VERSION}" == 2* ]]; then helm init --client-only; else echo "using helm3, no need to initialize helm"; fi' \ - && helm plugin install https://github.com/hypnoglow/helm-s3.git --version=${S3_PLUGIN_VERSION} \ - && helm plugin install https://github.com/nouney/helm-gcs.git --version=${GCS_PLUGIN_VERSION} \ - && helm plugin install https://github.com/chartmuseum/helm-push.git --version=${PUSH_PLUGIN_VERSION} + && curl -L https://storage.googleapis.com/kubernetes-release/release/${KUBE_VERSION}/bin/linux/amd64/kubectl -o /usr/local/bin/kubectl \ + && chmod +x /usr/local/bin/kubectl +RUN bash -c 'if [[ "${HELM_VERSION}" == 2* ]]; then helm init --client-only; else echo "using helm3, no need to initialize helm"; fi' \ + && helm plugin install https://github.com/hypnoglow/helm-s3.git \ + && helm plugin install https://github.com/nouney/helm-gcs.git \ + && helm plugin install https://github.com/chartmuseum/helm-push.git # Run acceptance tests COPY Makefile Makefile @@ -26,17 +29,30 @@ RUN apt-get update \ && apt-get install -y python3-venv \ && make acceptance -FROM codefresh/kube-helm:${HELM_VERSION} + +# MAIN +FROM python:${PYTHON_VERSION}-alpine${ALPINE_VERSION} + +WORKDIR /config + ARG HELM_VERSION -COPY --from=setup /temp /root/.helm/* /root/.helm/ -COPY bin/* /opt/bin/ -RUN chmod +x /opt/bin/* -COPY lib/* /opt/lib/ +ENV HELM_VERSION ${HELM_VERSION} -# Install Python3 -RUN apk add --no-cache python3 \ +RUN echo "HELM_VERSION is set to: ${HELM_VERSION}" + +RUN apk add --update ca-certificates && update-ca-certificates \ + && apk add --update --no-cache curl bash jq make git openssl \ + && pip install yq \ + && rm /var/cache/apk/* \ + && rm -rf /tmp/* \ && rm -rf /root/.cache -ENV HELM_VERSION ${HELM_VERSION} +COPY --from=setup /usr/local/bin/helm /usr/local/bin/helm +COPY --from=setup /usr/local/bin/kubectl /usr/local/bin/kubectl + +RUN bash -c 'if [[ "${HELM_VERSION}" == 2* ]]; then helm init --client-only; else echo "using helm3, no need to initialize helm"; fi' + +COPY bin/* /opt/bin/ +COPY lib/* /opt/lib/ -ENTRYPOINT ["/opt/bin/release_chart"] \ No newline at end of file +ENTRYPOINT ["/opt/bin/release_chart"]