feed-fetcher/Dockerfile

14 lines
460 B
Docker
Raw Permalink Normal View History

2021-03-21 08:42:56 +00:00
FROM golang:1.16-alpine AS builder
2021-03-17 09:56:45 +00:00
RUN apk update && apk add --no-cache git && apk add -U --no-cache ca-certificates
2021-03-17 09:51:00 +00:00
WORKDIR /app/
ADD go.mod go.sum ./
RUN go mod download
ADD . .
2021-03-17 09:56:45 +00:00
RUN GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -ldflags="-w -s" -o feed-fetcher main.go
2021-03-17 09:51:00 +00:00
2021-03-17 09:56:45 +00:00
FROM scratch
WORKDIR /app/
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=builder /app/feed-fetcher /app/feed-fetcher
2021-03-17 09:51:00 +00:00
ENTRYPOINT ["/app/feed-fetcher"]