docker: Multistage Docker build (#6)
Reducing image size approximately from 341MB to 16MB
This commit is contained in:
parent
ead67c221f
commit
10645aa3a5
12
Dockerfile
12
Dockerfile
@ -1,4 +1,4 @@
|
||||
FROM golang:alpine
|
||||
FROM golang:alpine AS builder
|
||||
|
||||
EXPOSE 8000/tcp
|
||||
|
||||
@ -17,3 +17,13 @@ RUN go get -v -d
|
||||
RUN go get github.com/GeertJohan/go.rice/rice
|
||||
RUN GOROOT=/go rice embed-go
|
||||
RUN go install -v
|
||||
|
||||
|
||||
FROM alpine
|
||||
|
||||
EXPOSE 8000/tcp
|
||||
ENTRYPOINT ["pastebin"]
|
||||
|
||||
COPY --from=builder /go/bin/pastebin /bin/pastebin
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user