2021-02-18 18:32:36 +00:00
|
|
|
FROM golang:alpine AS builder
|
2021-02-18 19:41:27 +00:00
|
|
|
RUN apk update && apk add --no-cache git && apk add -U --no-cache ca-certificates
|
2021-02-18 18:32:36 +00:00
|
|
|
WORKDIR /app/
|
|
|
|
ADD go.mod go.sum ./
|
|
|
|
RUN go mod download
|
|
|
|
ADD . .
|
|
|
|
RUN GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -ldflags="-w -s" -o tweetsvg main.go
|
|
|
|
|
|
|
|
FROM scratch
|
|
|
|
|
|
|
|
WORKDIR /app/
|
|
|
|
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
|
|
|
|
COPY --from=builder /app/tweetsvg /app/tweetsvg
|
2021-02-18 19:53:03 +00:00
|
|
|
ADD tweet.svg.tmpl .
|
2021-02-18 18:32:36 +00:00
|
|
|
|
|
|
|
ENTRYPOINT ["/app/tweetsvg"]
|