Skip to content

Commit

Permalink
Merge pull request #56 from Dr-N00B/release-4.1
Browse files Browse the repository at this point in the history
build with script
  • Loading branch information
santhoshdaivajna authored Oct 16, 2023
2 parents fa2a68e + 8ebdb7a commit 9abb3db
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ build-cosign:
SAVE ARTIFACT /ko-app/cosign cosign

go-deps:
FROM gcr.io/spectro-dev-public/edge-native/golang:${GOLANG_VERSION}-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

Expand All @@ -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-static.sh -a -o ${BIN} ./${SRC}
END

RUN go build -ldflags "${LDFLAGS}" -o ${BIN} ./${SRC}
SAVE ARTIFACT ${BIN} ${BIN} AS LOCAL build/${BIN}

VERSION:
Expand Down

0 comments on commit 9abb3db

Please sign in to comment.