echoip/Dockerfile

19 lines
366 B
Docker
Raw Normal View History

2018-12-28 19:04:36 +01:00
# Build
2021-01-24 15:07:45 +01:00
FROM golang:1.15-buster AS build
2018-08-27 23:30:18 +02:00
WORKDIR /go/src/github.com/mpolden/echoip
2018-12-28 19:04:36 +01:00
COPY . .
2021-01-24 15:07:45 +01:00
2019-03-29 20:38:43 +01:00
# Must build without cgo because libc is unavailable in runtime image
ENV GO111MODULE=on CGO_ENABLED=0
RUN make
2018-07-30 01:02:57 +02:00
# Run
2018-12-28 19:04:36 +01:00
FROM scratch
EXPOSE 8080
2020-12-14 19:02:35 +01:00
COPY --from=build /go/bin/echoip /opt/echoip/
COPY html /opt/echoip/html
2018-12-28 19:04:36 +01:00
WORKDIR /opt/echoip
ENTRYPOINT ["/opt/echoip/echoip"]