mirror of
https://github.com/TECHNOFAB11/docsonnet.git
synced 2026-02-02 07:35:11 +01:00
feat: containerize (#19)
* feat: containerize * Stripping reduces binary size, fully static linking makes the binary more portable Co-authored-by: sh0rez <me@shorez.de>
This commit is contained in:
parent
3e1757637e
commit
1f8d4c6fbf
11 changed files with 47 additions and 15 deletions
19
Dockerfile
Normal file
19
Dockerfile
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
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"]
|
||||
Loading…
Add table
Add a link
Reference in a new issue