From d82f50f4bc3dc568e26bb4cde7a0629697969ec2 Mon Sep 17 00:00:00 2001 From: Jonathan Crooke Date: Mon, 21 Jan 2019 17:57:38 +0100 Subject: [PATCH] Create Dockerfile https://raw.githubusercontent.com/svengo/docker-watchtower/master/Dockerfile --- Dockerfile | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..e61b550 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,39 @@ +# +# Builder +# + +FROM golang:alpine as builder +ARG SOURCE=itsthejb +RUN \ + apk add --no-cache \ + alpine-sdk \ + ca-certificates \ + git \ + tzdata && \ + \ + mkdir --parents $GOPATH/src/github.com/${SOURCE} && \ + cd $GOPATH/src/github.com/${SOURCE} && \ + git clone https://github.com/${SOURCE}/watchtower.git && \ + cd watchtower && \ + \ + curl https://glide.sh/get | sh && \ + glide install && \ + \ + CGO_ENABLED=0 GOOS=linux go build -a -ldflags '-extldflags "-static"' . && \ + go test + + +# +# watchtower +# + +FROM scratch + +LABEL "com.centurylinklabs.watchtower"="true" + +# copy files from other container +COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt +COPY --from=builder /usr/share/zoneinfo /usr/share/zoneinfo +COPY --from=builder /go/src/github.com/${SOURCE}/watchtower/watchtower /watchtower + +ENTRYPOINT ["/watchtower"]