whatismyip/Dockerfile

23 lines
331 B
Docker
Raw Normal View History

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