From 1ffa2f06131c46e4096291e3ba90d71e142784ce Mon Sep 17 00:00:00 2001 From: Sam Nguyen Date: Tue, 8 Aug 2023 17:15:00 -0400 Subject: [PATCH 1/2] Use CGO_ENABLED=1 --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 4f9433b..fd3cb2e 100644 --- a/Makefile +++ b/Makefile @@ -37,7 +37,7 @@ README.md: $(EMBEDMD) tmp/help.txt $(EMBEDMD) -w README.md token-refresher: vendor main.go $(wildcard *.go) $(wildcard */*.go) - CGO_ENABLED=0 GOEXPERIMENT=boringcrypto GOOS=$(OS) GOARCH=$(GOARCH) GO111MODULE=on GOPROXY=https://proxy.golang.org go build -mod vendor -a -ldflags '-s -w' -o $@ . + CGO_ENABLED=1 GOEXPERIMENT=boringcrypto GOOS=$(OS) GOARCH=$(GOARCH) GO111MODULE=on GOPROXY=https://proxy.golang.org go build -mod vendor -a -ldflags '-s -w' -o $@ . .PHONY: build build: token-refresher From 3b3a9326925598138297506cf2508cd43ac16938 Mon Sep 17 00:00:00 2001 From: Sam Nguyen Date: Thu, 17 Aug 2023 09:39:16 -0400 Subject: [PATCH 2/2] Set ubi-miminal docker image --- Dockerfile | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index ae8dd6a..f7e4fe4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ -FROM --platform=$BUILDPLATFORM golang:1.19-alpine3.16 as builder +FROM registry.access.redhat.com/ubi8/ubi-minimal:latest as builder -RUN apk add --update --no-cache ca-certificates tzdata git make bash && update-ca-certificates +RUN microdnf install go-toolset make ADD . /opt WORKDIR /opt @@ -11,9 +11,8 @@ ARG TARGETOS TARGETARCH RUN GOOS=${TARGETOS} GOARCH=${TARGETARCH} make token-refresher -FROM scratch as runner +FROM registry.access.redhat.com/ubi8/ubi-minimal:latest -COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ COPY --from=builder /opt/token-refresher /bin/token-refresher ARG BUILD_DATE