echoip/Dockerfile
2025-11-15 12:46:07 +00:00

19 lines
419 B
Docker

# Build
FROM golang:1.25-trixie 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 gcr.io/distroless/static-debian12
EXPOSE 8080
COPY --from=build /go/bin/echoip /opt/echoip/
COPY html /opt/echoip/html
COPY data /opt/echoip/data
WORKDIR /opt/echoip
ENTRYPOINT ["/opt/echoip/echoip"]