mirror of
https://github.com/mpolden/echoip.git
synced 2024-11-10 07:27:22 +01:00
18 lines
403 B
Docker
18 lines
403 B
Docker
# Build
|
|
FROM golang:1.12-stretch AS build
|
|
WORKDIR /go/src/github.com/mpolden/echoip
|
|
COPY . .
|
|
# Must build without cgo because libc is unavailable in runtime image
|
|
ENV GO111MODULE=on CGO_ENABLED=0
|
|
RUN make
|
|
|
|
# Run
|
|
FROM scratch
|
|
EXPOSE 8080
|
|
COPY --from=build \
|
|
/go/bin/echoip \
|
|
/go/src/github.com/mpolden/echoip/index.html \
|
|
/opt/echoip/
|
|
WORKDIR /opt/echoip
|
|
ENTRYPOINT ["/opt/echoip/echoip"]
|