aboutsummaryrefslogtreecommitdiffstats
path: root/Dockerfile
diff options
context:
space:
mode:
authorterminaldweller <thabogre@gmail.com>2023-01-17 12:05:39 +0000
committerterminaldweller <thabogre@gmail.com>2023-01-17 12:05:39 +0000
commitf3c36dad4ec3e17042741d475848bca913e48f3c (patch)
tree36fade01013055da16e68af812d1dfcdaec83846 /Dockerfile
parentInitial commit (diff)
downloadicanhazallips-f3c36dad4ec3e17042741d475848bca913e48f3c.tar.gz
icanhazallips-f3c36dad4ec3e17042741d475848bca913e48f3c.zip
first commit
Diffstat (limited to '')
-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"]