mirror of
https://github.com/containrrr/watchtower.git
synced 2026-03-01 02:10:16 +01:00
Change Dockerfile to be compatible with automatic builds
This commit is contained in:
parent
203f24b35c
commit
a2ba221ad3
3 changed files with 35 additions and 47 deletions
34
Dockerfile
34
Dockerfile
|
|
@ -1,18 +1,34 @@
|
|||
FROM alpine:3.9 as alpine
|
||||
#
|
||||
# Builder
|
||||
#
|
||||
|
||||
FROM golang:alpine as builder
|
||||
|
||||
RUN apk add --no-cache \
|
||||
alpine-sdk \
|
||||
ca-certificates \
|
||||
git \
|
||||
tzdata
|
||||
|
||||
WORKDIR /usr/local/src
|
||||
COPY . .
|
||||
|
||||
RUN \
|
||||
GO111MODULE=on CGO_ENABLED=0 GOOS=linux go build -a -ldflags '-extldflags "-static"' . && \
|
||||
GO111MODULE=on go test ./... -v
|
||||
|
||||
|
||||
#
|
||||
# watchtower
|
||||
#
|
||||
|
||||
FROM scratch
|
||||
|
||||
LABEL "com.centurylinklabs.watchtower"="true"
|
||||
|
||||
COPY --from=alpine \
|
||||
/etc/ssl/certs/ca-certificates.crt \
|
||||
/etc/ssl/certs/ca-certificates.crt
|
||||
COPY --from=alpine \
|
||||
/usr/share/zoneinfo \
|
||||
/usr/share/zoneinfo
|
||||
# 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 /usr/local/src/watchtower /watchtower
|
||||
|
||||
COPY watchtower /
|
||||
ENTRYPOINT ["/watchtower"]
|
||||
ENTRYPOINT ["/watchtower"]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue