From 161e6bf08e814d085d82caa4f550f66966a223ae Mon Sep 17 00:00:00 2001 From: Dan Pegg Date: Fri, 22 Jul 2022 19:17:15 +0100 Subject: [PATCH] Fix binary download, use alpine:16, copy root certificates into final image (#1100) Scratch doesn't have root certificates by default, which means forwarding to a HTTPS endpoint doesn't work without skipping verification. To fix this, we can copy the certificate bundle into scratch from the alpine image. I've also bumped the alpine version up to 3.16, and fixed the wget. This has fixed my issues, but let me know if you think anything looks wrong here! --- Dockerfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 0e14c35..b063b8c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,12 @@ -FROM alpine:3.12 as builder +FROM alpine:3.16 as builder ARG RELEASE_VERSION RUN apk add --no-cache ca-certificates openssl -RUN wget https://github.com/buger/goreplay/releases/download/v${RELEASE_VERSION}/gor_${RELEASE_VERSION}_x64.tar.gz -O gor.tar.gz +RUN wget https://github.com/buger/goreplay/releases/download/${RELEASE_VERSION}/gor_${RELEASE_VERSION}_x64.tar.gz -O gor.tar.gz RUN tar xzf gor.tar.gz FROM scratch +COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ COPY --from=builder /gor . ENTRYPOINT ["./gor"]