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
|
|
|
|
|
2020-06-05 03:07:04 +02:00
|
|
|
ENV WATCHTOWER_VERSION v1.0.2
|
2018-06-23 21:38:35 +02:00
|
|
|
|
2019-05-25 22:41:50 +02:00
|
|
|
RUN git clone --depth 1 --branch ${WATCHTOWER_VERSION} https://github.com/containrrr/watchtower /go/src/github.com/containrrr/watchtower
|
2018-09-14 21:34:31 +02:00
|
|
|
|
2019-05-25 22:41:50 +02:00
|
|
|
WORKDIR /go/src/github.com/containrrr/watchtower
|
2018-06-23 21:38:35 +02:00
|
|
|
|
2019-05-25 22:41:50 +02:00
|
|
|
RUN GO111MODULE=on go build -o /usr/bin/watchtower
|
2018-09-14 21:34:31 +02:00
|
|
|
|
|
|
|
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" ]
|