# https://hub.docker.com/r/hashicorp/terraform/tags FROM hashicorp/terraform:latest as terraform # https://hub.docker.com/r/google/cloud-sdk/tags FROM google/cloud-sdk:alpine as gcloud RUN gcloud components update \ && gcloud components install kubectl FROM golang:alpine as gobuilder RUN apk add --no-cache --update git RUN git clone --depth 1 https://github.com/abetterinternet/prio-server src/github.com/abetterinternet/prio-server RUN cd src/github.com/abetterinternet/prio-server/deploy-tool && go build FROM alpine:latest as builder RUN apk add --no-cache --update bash curl gcc cmake make python3-dev libffi-dev musl-dev openssl openssl-dev \ && ln -snf `which python3` /bin/python \ && ln -snf `which pip3` /bin/pip RUN addgroup -g 1000 -S clouder && adduser -u 1000 -h /home/clouder -S clouder -G clouder RUN mkdir -p /opt/clouder/bin && chown -cR clouder:clouder /opt/clouder RUN mkdir -p /opt/aws-cli && chown -cR clouder:clouder /opt/aws-cli USER clouder RUN python -mvenv /opt/aws-cli RUN /opt/aws-cli/bin/pip install --upgrade pip setuptools wheel RUN /opt/aws-cli/bin/pip install --upgrade --upgrade-strategy eager \ https://github.com/boto/botocore/archive/v2.zip \ https://github.com/aws/aws-cli/archive/v2.zip ENV DESIRED_VERSION=v3.6.3 RUN curl --progress-bar -fSL https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 \ | HELM_INSTALL_DIR=/opt/clouder/bin USE_SUDO=false PATH="${PATH}:/opt/clouder/bin" bash FROM alpine:latest LABEL maintainer="Ezekiel Grave " RUN apk add --no-cache --update curl make git gnupg jq ncurses openssh-client openssl python3 \ && ln -snf `which python3` /bin/python RUN addgroup -g 1000 -S clouder && adduser -u 1000 -h /home/clouder -S clouder -G clouder RUN mkdir -p /opt/clouder/bin && chown -cR clouder:clouder /opt/clouder COPY --from=terraform --chown=clouder:clouder /bin/terraform /opt/clouder/bin/terraform COPY --from=gcloud /google-cloud-sdk /opt/google-cloud-sdk COPY --from=gobuilder --chown=clouder:clouder /go/src/github.com/abetterinternet/prio-server/deploy-tool/deploy-tool /opt/clouder/bin/deploy-tool COPY --from=builder --chown=clouder:clouder /opt/clouder/bin /opt/clouder/bin COPY --from=builder --chown=clouder:clouder /opt/aws-cli /opt/aws-cli RUN chown -cR clouder:clouder /opt/clouder \ && chmod u+x /opt/clouder/bin/* ENV PATH="/opt/clouder/bin:${PATH}:/opt/google-cloud-sdk/bin:/opt/aws-cli/bin" WORKDIR /home/clouder USER clouder RUN helm repo add stable https://charts.helm.sh/stable RUN gcloud config set core/disable_usage_reporting true \ && gcloud config set component_manager/disable_update_check true \ && gcloud config set metrics/environment github_docker_image \ && gcloud --version VOLUME /home/clouder CMD ["/bin/ash"]