mirror of
https://github.com/containrrr/watchtower.git
synced 2025-12-16 15:10:12 +01:00
Create Dockerfile
https://raw.githubusercontent.com/svengo/docker-watchtower/master/Dockerfile
This commit is contained in:
parent
8197bb669d
commit
d82f50f4bc
1 changed files with 39 additions and 0 deletions
39
Dockerfile
Normal file
39
Dockerfile
Normal file
|
|
@ -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"]
|
||||||
Loading…
Add table
Add a link
Reference in a new issue