mirror of https://github.com/mpolden/echoip
Reduce image size
This commit is contained in:
parent
14f1a0ce88
commit
c623168acb
23
Dockerfile
23
Dockerfile
|
@ -1,15 +1,16 @@
|
||||||
# Compile
|
# Build
|
||||||
FROM golang:1.11-alpine AS build
|
FROM golang:1.11-stretch AS build
|
||||||
ADD . /go/src/github.com/mpolden/echoip
|
|
||||||
WORKDIR /go/src/github.com/mpolden/echoip
|
WORKDIR /go/src/github.com/mpolden/echoip
|
||||||
RUN apk --update add git gcc musl-dev
|
COPY . .
|
||||||
ENV GO111MODULE=on
|
ENV GO111MODULE=on CGO_ENABLED=0
|
||||||
RUN go get -d -v .
|
|
||||||
RUN go install ./...
|
RUN go install ./...
|
||||||
|
|
||||||
# Run
|
# Run
|
||||||
FROM alpine
|
FROM scratch
|
||||||
RUN mkdir -p /opt/
|
EXPOSE 8080
|
||||||
COPY --from=build /go/bin/echoip /opt/
|
COPY --from=build \
|
||||||
WORKDIR /opt/
|
/go/bin/echoip \
|
||||||
ENTRYPOINT ["/opt/echoip"]
|
/go/src/github.com/mpolden/echoip/index.html \
|
||||||
|
/opt/echoip/
|
||||||
|
WORKDIR /opt/echoip
|
||||||
|
ENTRYPOINT ["/opt/echoip/echoip"]
|
||||||
|
|
Loading…
Reference in New Issue