mirror of
https://github.com/TECHNOFAB11/docsonnet.git
synced 2025-12-11 22:10:13 +01:00
* feat: containerize * Stripping reduces binary size, fully static linking makes the binary more portable Co-authored-by: sh0rez <me@shorez.de>
19 lines
328 B
Docker
19 lines
328 B
Docker
FROM golang:1.16.4 as base
|
|
|
|
ENV GO111MODULE=on
|
|
WORKDIR /app
|
|
|
|
COPY go.mod .
|
|
COPY go.sum .
|
|
|
|
RUN go mod download
|
|
|
|
COPY . .
|
|
|
|
FROM base AS builder
|
|
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags='-s -w -extldflags "-static"' .
|
|
|
|
FROM alpine:3.12
|
|
COPY --from=builder /app/docsonnet /usr/local/bin
|
|
|
|
ENTRYPOINT ["docsonnet"]
|