From b8715338ba718cf0da9858b6dd0c5e2bad91fad1 Mon Sep 17 00:00:00 2001 From: Jess Frazelle Date: Wed, 21 Sep 2016 09:17:38 -0700 Subject: [PATCH] add clean-registry image Signed-off-by: Jess Frazelle --- clean-registry/Dockerfile | 45 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 clean-registry/Dockerfile diff --git a/clean-registry/Dockerfile b/clean-registry/Dockerfile new file mode 100644 index 0000000..886c796 --- /dev/null +++ b/clean-registry/Dockerfile @@ -0,0 +1,45 @@ +FROM python:2-alpine + +RUN apk add --no-cache \ + ca-certificates \ + bash + +# Install google cloud sdk +# Download clean-registry script +RUN set -x \ + && apk add --no-cache --virtual .build-deps \ + curl \ + tar \ + && curl -sSL -o /tmp/google-cloud-sdk.tar.gz https://dl.google.com/dl/cloudsdk/release/google-cloud-sdk.tar.gz \ + && curl -sSL -o /usr/bin/clean-registry https://raw.githubusercontent.com/jfrazelle/dotfiles/master/bin/clean-registry \ + && chmod +x /usr/bin/clean-registry \ + && mkdir -p /usr/src/google-cloud-sdk \ + && tar -xzf /tmp/google-cloud-sdk.tar.gz -C /usr/src/google-cloud-sdk --strip-components 1 \ + && rm /tmp/google-cloud-sdk.tar.gz \ + && ( \ + cd /usr/src/google-cloud-sdk \ + && ./install.sh \ + --usage-reporting false \ + --path-update true \ + ) \ + && apk del .build-deps + +WORKDIR /root +ENV PATH $PATH:/usr/src/google-cloud-sdk/bin +ENV GOPATH /go + +# Install reg +RUN set -x \ + && apk add --no-cache --virtual .build-deps \ + go \ + git \ + gcc \ + libc-dev \ + libgcc \ + && go get github.com/jfrazelle/reg \ + && mv ${GOPATH}/bin/reg /usr/bin/reg \ + && apk del .build-deps \ + && rm -rf /go \ + && echo "Build complete." + +ENTRYPOINT ["clean-registry"]