mirror of
https://github.com/containrrr/watchtower.git
synced 2025-12-16 15:10:12 +01:00
Changed dockerfile, build is now passing
This commit is contained in:
parent
0e93a8c612
commit
d09bb3ca26
1 changed files with 43 additions and 14 deletions
57
Dockerfile
57
Dockerfile
|
|
@ -1,20 +1,49 @@
|
|||
##
|
||||
## Alpine image to get some needed data
|
||||
##
|
||||
#FROM alpine:latest as alpine
|
||||
#RUN apk add --no-cache \
|
||||
# ca-certificates \
|
||||
# tzdata
|
||||
#
|
||||
# Alpine image to get some needed data
|
||||
##
|
||||
## Image
|
||||
##
|
||||
#FROM scratch
|
||||
#LABEL "com.centurylinklabs.watchtower"="true"
|
||||
#
|
||||
FROM alpine:latest as alpine
|
||||
## copy files from other containers
|
||||
#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 watchtower /
|
||||
#ENTRYPOINT ["/watchtower"]
|
||||
|
||||
# build stage
|
||||
FROM golang:alpine AS build-env
|
||||
|
||||
RUN apk add --no-cache openssh-client git curl
|
||||
|
||||
RUN curl https://glide.sh/get | sh
|
||||
|
||||
WORKDIR /go/src/github.com/v2tec/watchtower
|
||||
COPY . .
|
||||
|
||||
# RUN set -x && \
|
||||
# go get github.com/golang/dep/cmd/dep && \
|
||||
# dep ensure -v
|
||||
RUN glide install
|
||||
|
||||
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o watchtower .
|
||||
# RUN go build -o watchtower .
|
||||
|
||||
# final stage
|
||||
FROM alpine
|
||||
LABEL "com.centurylinklabs.watchtower"="true"
|
||||
|
||||
RUN apk add --no-cache \
|
||||
ca-certificates \
|
||||
tzdata
|
||||
|
||||
#
|
||||
# Image
|
||||
#
|
||||
FROM scratch
|
||||
LABEL "com.centurylinklabs.watchtower"="true"
|
||||
|
||||
# copy files from other containers
|
||||
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 watchtower /
|
||||
ENTRYPOINT ["/watchtower"]
|
||||
COPY --from=build-env /go/src/github.com/v2tec/watchtower/watchtower /
|
||||
ENTRYPOINT ["/watchtower"]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue