mirror of
https://github.com/costela/docker-etchosts.git
synced 2025-05-11 18:05:42 +02:00
use multi-stage build to reduce image size
This commit is contained in:
parent
4c0f6f4f8b
commit
0080837e88
1 changed files with 7 additions and 3 deletions
10
Dockerfile
10
Dockerfile
|
@ -1,4 +1,4 @@
|
||||||
FROM golang:1.11-alpine
|
FROM golang:1.11-alpine AS build
|
||||||
|
|
||||||
WORKDIR /go/src/app
|
WORKDIR /go/src/app
|
||||||
|
|
||||||
|
@ -10,6 +10,10 @@ RUN dep ensure -vendor-only
|
||||||
|
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
RUN go install -v
|
RUN go build -v
|
||||||
|
|
||||||
CMD ["app"]
|
FROM alpine
|
||||||
|
WORKDIR /app
|
||||||
|
COPY --from=build /go/src/app/app /app
|
||||||
|
|
||||||
|
CMD [ "./app" ]
|
Loading…
Add table
Add a link
Reference in a new issue