Use alpine for builder in Dockerfile

This commit is contained in:
Torjus Håkestad 2021-12-04 10:25:54 +01:00
parent 1b2cb55843
commit 3c72409c5c

View File

@ -1,14 +1,10 @@
FROM golang:latest as builder-base
FROM golang:alpine as builder-base
WORKDIR /app
COPY go.mod /app/go.mod
COPY go.sum /app/go.sum
RUN go mod download
COPY . /app
RUN CGO_ENABLED=0 go build -o ezshare cmd/ezshare.go
FROM builder-base as certs
VOLUME ["/data"]
CMD ["/app/scripts/gencerts.sh"]
RUN go build -o ezshare cmd/ezshare.go
FROM builder-base as cross-compiler
VOLUME ["/data"]