forked from beevee/konturtransferbot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
27 lines (25 loc) · 1.01 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
FROM golang:alpine as golang
WORKDIR /go/src/github.com/beevee/konturtransferbot
COPY . .
RUN apk add --no-cache git mercurial \
&& go get github.com/kardianos/govendor \
&& govendor sync \
&& apk del git mercurial
# Static build required so that we can safely copy the binary over.
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o /go/bin/konturtransferbot github.com/beevee/konturtransferbot/cmd/konturtransferbot
FROM alpine:latest as alpine
RUN apk --no-cache add tzdata zip ca-certificates
WORKDIR /usr/share/zoneinfo
# -0 means no compression. Needed because go's
# tz loader doesn't handle compressed data.
RUN zip -r -0 /zoneinfo.zip .
FROM scratch
# the program:
COPY cmd/konturtransferbot/schedule.yml /schedule.yml
COPY --from=golang /go/bin/konturtransferbot /konturtransferbot
# the timezone data:
ENV ZONEINFO /zoneinfo.zip
COPY --from=alpine /zoneinfo.zip /
# the tls certificates:
COPY --from=alpine /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
ENTRYPOINT ["/konturtransferbot"]