aboutsummaryrefslogtreecommitdiffstats
path: root/Dockerfile
diff options
context:
space:
mode:
Diffstat (limited to 'Dockerfile')
-rw-r--r--Dockerfile20
1 files changed, 20 insertions, 0 deletions
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000..fdd725a
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,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="/C=US/ST=Denial/L=springfield/O=Dis/CN=localhost" -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"]