Skip to content

Commit

Permalink
Switch runtime to alpine base image
Browse files Browse the repository at this point in the history
  • Loading branch information
beevee committed Feb 18, 2021
1 parent bd6fc74 commit cbe8d04
Showing 1 changed file with 2 additions and 15 deletions.
17 changes: 2 additions & 15 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,10 @@ 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:
FROM alpine
RUN apk add --no-cache ca-certificates && update-ca-certificates
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"]

0 comments on commit cbe8d04

Please sign in to comment.