aboutsummaryrefslogtreecommitdiffstats
path: root/Dockerfile
blob: 917b592f44d8e53385cd22714a9ac1f83117f680 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
FROM alpine:3.17 as builder
ENV GOPROXY=https://goproxy.io
RUN apk update && apk upgrade
RUN apk add go git
ENV GOPROXY=https://goproxy.io
COPY go.* /icanhazallips/
RUN cd /icanhazallips && go mod download
COPY *.go /icanhazallips/
RUN cd /icanhazallips && go build

FROM alpine:3.17 as certbuilder
RUN apk add openssl
WORKDIR /certs
RUN openssl req -nodes -new -x509 -subj="CN=icanhazallips.terminaldweller.com" -keyout server.key -out server.cert

FROM gcr.io/distroless/static-debian11
# FROM alpine:3.17
COPY --from=certbuilder /certs /certs
COPY --from=builder /icanhazallips/icanhazallips /icanhazallips/icanhazallips
ENTRYPOINT ["/icanhazallips/icanhazallips"]