Verified Commit 2bcfd452 authored by meskio's avatar meskio 🐾
Browse files

Proxy is now compiled static and other clean ups

Make the proxy binary a static binary so we can run it in a 'scratch'
container. Use the official golang images to build it and make the
version configurable on build time.
parent 9c09d96e
FROM alpine:3.14 AS builder
RUN apk add --update go git
FROM golang:1.15 AS builder
WORKDIR /builder
RUN git clone -b v1.1.0
RUN git clone -b ${VERSION}
WORKDIR /builder/snowflake/proxy
RUN go get
RUN go build -o proxy .
RUN CGO_ENABLED=0 go build -o proxy -ldflags '-extldflags "-static"' .
FROM scratch
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
COPY --from=builder /usr/share/zoneinfo /usr/share/zoneinfo
COPY --from=builder /builder/snowflake/proxy/proxy /bin/proxy
FROM alpine:3.14
COPY --from=builder /builder/snowflake/proxy/proxy /proxy
ENTRYPOINT [ "/proxy" ]
ENTRYPOINT [ "/bin/proxy" ]
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment