pkgs/Dockerfile

21 lines
334 B
Text
Raw Normal View History

2021-06-10 20:33:32 +00:00
FROM golang:alpine as builder
LABEL maintainer="ptrcnull <docker@ptrcnull.me>"
WORKDIR /src
COPY go.mod go.sum ./
RUN go mod download
COPY main.go .
COPY utils ./utils
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o server main.go
FROM scratch
WORKDIR /app
COPY --from=builder /src/server .
CMD ["/app/server"]