2018-09-14 21:34:31 +02:00
|
|
|
FROM golang:alpine as builder
|
2018-06-23 21:38:35 +02:00
|
|
|
LABEL maintainer "Jess Frazelle <jess@linux.com>"
|
|
|
|
|
2018-09-14 21:34:31 +02:00
|
|
|
RUN apk --no-cache add \
|
|
|
|
ca-certificates \
|
|
|
|
gcc \
|
|
|
|
git \
|
|
|
|
libc-dev
|
|
|
|
|
2018-06-23 21:38:35 +02:00
|
|
|
ENV PATH /go/bin:/usr/local/go/bin:$PATH
|
|
|
|
ENV GOPATH /go
|
|
|
|
|
|
|
|
ENV WATCHTOWER_VERSION v0.3.0
|
|
|
|
|
2018-09-14 21:34:31 +02:00
|
|
|
RUN git clone --depth 1 --branch ${WATCHTOWER_VERSION} https://github.com/v2tec/watchtower /go/src/github.com/v2tec/watchtower
|
|
|
|
|
|
|
|
RUN go get github.com/Masterminds/glide
|
2018-06-23 21:38:35 +02:00
|
|
|
|
2018-09-14 21:34:31 +02:00
|
|
|
WORKDIR /go/src/github.com/v2tec/watchtower
|
|
|
|
|
|
|
|
RUN glide install
|
|
|
|
RUN go build -o /usr/bin/watchtower
|
|
|
|
|
|
|
|
FROM alpine:latest
|
|
|
|
COPY --from=builder /usr/bin/watchtower /usr/bin/watchtower
|
|
|
|
COPY --from=builder /etc/ssl/certs/ /etc/ssl/certs
|
2018-06-23 21:38:35 +02:00
|
|
|
|
|
|
|
ENTRYPOINT [ "watchtower" ]
|
|
|
|
CMD [ "--help" ]
|