feat: multistage Dockerfile
This commit is contained in:
parent
6b080f3821
commit
b4524bf0c4
1 changed files with 10 additions and 2 deletions
12
Dockerfile
12
Dockerfile
|
@ -1,4 +1,12 @@
|
||||||
FROM centurylink/ca-certs
|
# stage 0
|
||||||
|
FROM golang:latest as builder
|
||||||
|
WORKDIR /go/src/github.com/PierreZ/goStatic
|
||||||
|
COPY . .
|
||||||
|
|
||||||
COPY goStatic /
|
RUN GOARCH=amd64 GOOS=linux go build -ldflags "-linkmode external -extldflags -static -w"
|
||||||
|
|
||||||
|
# stage 1
|
||||||
|
FROM centurylink/ca-certs
|
||||||
|
WORKDIR /
|
||||||
|
COPY --from=builder /go/src/github.com/PierreZ/goStatic/goStatic .
|
||||||
ENTRYPOINT ["/goStatic"]
|
ENTRYPOINT ["/goStatic"]
|
Loading…
Reference in a new issue