2016-09-21 18:17:38 +02:00
|
|
|
FROM python:2-alpine
|
|
|
|
|
|
|
|
RUN apk add --no-cache \
|
|
|
|
ca-certificates \
|
2016-09-22 03:25:50 +02:00
|
|
|
bash \
|
|
|
|
parallel
|
2016-09-21 18:17:38 +02:00
|
|
|
|
|
|
|
# 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 \
|
2016-09-30 19:47:34 +02:00
|
|
|
&& curl -sSL -o /usr/bin/clean-registry https://raw.githubusercontent.com/jessfraz/dotfiles/master/bin/clean-registry \
|
2016-09-21 18:17:38 +02:00
|
|
|
&& 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 \
|
2016-09-30 19:47:34 +02:00
|
|
|
&& go get github.com/jessfraz/reg \
|
2016-09-21 18:17:38 +02:00
|
|
|
&& mv ${GOPATH}/bin/reg /usr/bin/reg \
|
|
|
|
&& apk del .build-deps \
|
|
|
|
&& rm -rf /go \
|
|
|
|
&& echo "Build complete."
|
|
|
|
|
|
|
|
ENTRYPOINT ["clean-registry"]
|