1 FROM golang:1.10-alpine 2 ADD . /go/src/repodiff 3 RUN apk --no-cache add \ 4 curl \ 5 git \ 6 build-base \ 7 && curl https://raw.githubusercontent.com/golang/dep/5bdae264c61be23446d622ea84a1c97b895f78cc/install.sh | sh \ 8 && curl https://storage.googleapis.com/git-repo-downloads/repo > /bin/repo \ 9 && chmod a+x /bin/repo \ 10 && cd /go/src/repodiff \ 11 && dep ensure \ 12 && go install repodiff \ 13 && cp config.json /go/bin/ \ 14 && cp .gitcookies /go/bin/ \ 15 && cp .gitconfig /go/bin/ \ 16 && cp credentials.json /go/bin/ 17 18 FROM alpine:3.7 19 RUN apk --no-cache add \ 20 bash \ 21 git \ 22 python \ 23 && mkdir -p /app_output 24 COPY --from=0 /bin/repo /bin/repo 25 WORKDIR /app 26 COPY --from=0 /go/bin/repodiff . 27 COPY --from=0 /go/bin/config.json . 28 COPY --from=0 /go/bin/.git* /root/ 29 COPY --from=0 /go/bin/credentials.json . 30 COPY --from=0 /go/bin/credentials.json . 31 COPY --from=0 /go/src/repodiff/*py ./pytools/ 32 COPY --from=0 /go/src/repodiff/*txt ./pytools/ 33 34 ENV GCP_DB_INSTANCE_CONNECTION_NAME_DEV=$GCP_DB_INSTANCE_CONNECTION_NAME_DEV 35 ENV GCP_DB_USER_DEV=$GCP_DB_USER_DEV 36 ENV GCP_DB_PASSWORD_DEV=$GCP_DB_PASSWORD_DEV 37 ENV GCP_DB_NAME_DEV=$GCP_DB_NAME_DEV 38 ENV GCP_DB_PROXY_PORT_DEV=$GCP_DB_PROXY_PORT_DEV 39 ENV GCP_DB_INSTANCE_CONNECTION_NAME_PROD=$GCP_DB_INSTANCE_CONNECTION_NAME_PROD 40 ENV GCP_DB_USER_PROD=$GCP_DB_USER_PROD 41 ENV GCP_DB_PASSWORD_PROD=$GCP_DB_PASSWORD_PROD 42 ENV GCP_DB_NAME_PROD=$GCP_DB_NAME_PROD 43 ENV GCP_DB_PROXY_PORT_PROD=$GCP_DB_PROXY_PORT_PROD 44 ENV ROLE="prod" 45 ENV GOOGLE_APPLICATION_CREDENTIALS="/app/credentials.json" 46 47 CMD ["./repodiff"] 48