From 3bc5378bf0ad8b58f46e19cee6b9340fd46b4d66 Mon Sep 17 00:00:00 2001 From: Arun Sharma Date: Fri, 6 Oct 2023 04:00:47 +0000 Subject: [PATCH] PE-2650 build from script Signed-off-by: Arun Sharma --- Earthfile | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/Earthfile b/Earthfile index bde11ce..d2b3b77 100644 --- a/Earthfile +++ b/Earthfile @@ -6,7 +6,7 @@ ARG IMAGE_REPOSITORY=quay.io/kairos ARG LUET_VERSION=0.34.0 ARG GOLINT_VERSION=v1.52.2 -ARG GOLANG_VERSION=1.19.10 +ARG GOLANG_VERSION=1.21 ARG RKE2_VERSION=latest ARG BASE_IMAGE_NAME=$(echo $BASE_IMAGE | grep -o [^/]*: | rev | cut -c2- | rev) @@ -23,11 +23,11 @@ build-cosign: SAVE ARTIFACT /ko-app/cosign cosign go-deps: - FROM gcr.io/spectro-dev-public/golang:1.19-debian + FROM gcr.io/spectro-images-public/golang:${GOLANG_VERSION}-alpine WORKDIR /build COPY go.mod go.sum ./ RUN go mod download - RUN apt-get update + RUN apk update SAVE ARTIFACT go.mod AS LOCAL go.mod SAVE ARTIFACT go.sum AS LOCAL go.sum @@ -39,15 +39,13 @@ BUILD_GOLANG: ARG SRC IF $FIPS_ENABLED - ARG LDFLAGS=-s -w -linkmode=external -extldflags=-static - ENV CGO_ENABLED=1 - ENV GOEXPERIMENT=boringcrypto + RUN go-build-fips.sh -a -o ${BIN} ./${SRC} + RUN assert-fips.sh ${BIN} + RUN assert-static.sh ${BIN} ELSE - ARG LDFLAGS=-s -w - ENV CGO_ENABLED=0 + RUN go-build.sh -a -o ${BIN} ./${SRC} END - RUN go build -ldflags "${LDFLAGS}" -o ${BIN} ./${SRC} SAVE ARTIFACT ${BIN} ${BIN} AS LOCAL build/${BIN} VERSION: