whatismyip/Dockerfile

23 lines
331 B
Docker
Raw Normal View History

2023-02-16 18:24:16 +00:00
FROM golang:1.20-alpine as builder
2021-11-10 19:06:12 +00:00
ARG ARG_VERSION
ENV VERSION $ARG_VERSION
2021-11-10 19:06:12 +00:00
WORKDIR /app
COPY . .
2023-04-29 16:18:31 +00:00
RUN apk add make git upx && make build VERSION=$VERSION \
&& upx --best --lzma whatismyip
2021-11-10 19:06:12 +00:00
# Build final image
FROM scratch
WORKDIR /app
COPY --from=builder /app/whatismyip /usr/bin/
EXPOSE 8080
ENTRYPOINT ["whatismyip"]