Skip to content

Commit 3fd824f

Browse files
authored
Merge pull request #41 from spectrocloud/fips-static-link-fix-4.0
Fips changes for Static Linking
2 parents d18ceee + a6578f4 commit 3fd824f

File tree

2 files changed

+17
-6
lines changed

2 files changed

+17
-6
lines changed

.github/workflows/spectro-release.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ jobs:
2020
uses: mukunku/[email protected]
2121
id: checkTag
2222
with:
23-
tag: spectro-v${{ github.event.inputs.release_version }}
23+
tag: v${{ github.event.inputs.release_version }}-spectro
2424
-
2525
if: ${{ steps.checkTag.outputs.exists == 'true' }}
2626
run: |
27-
echo "Tag already exists for spectro-v${{ github.event.inputs.release_version }}..."
27+
echo "Tag already exists for v${{ github.event.inputs.release_version }}-spectro..."
2828
exit 1
2929
-
3030
uses: actions/checkout@v3
@@ -60,9 +60,9 @@ jobs:
6060
env:
6161
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6262
with:
63-
tag_name: spectro-v${{ github.event.inputs.release_version }}
64-
release_name: Release spectro-v${{ github.event.inputs.release_version }}
63+
tag_name: v${{ github.event.inputs.release_version }}-spectro
64+
release_name: Release v${{ github.event.inputs.release_version }}-spectro
6565
body: |
66-
Release version ${{ github.event.inputs.release_version }}
66+
Release version v${{ github.event.inputs.release_version }}-spectro
6767
draft: false
6868
prerelease: false

Dockerfile

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
# Build the manager binary
2-
FROM golang:1.19.8 as builder
2+
FROM golang:1.19.10-alpine3.18 as builder
33

44
# FIPS
55
ARG CRYPTO_LIB
66
ENV GOEXPERIMENT=${CRYPTO_LIB:+boringcrypto}
77

88
WORKDIR /workspace
9+
RUN apk update
10+
RUN apk add git gcc g++ curl
11+
912
# Copy the Go Modules manifests
1013
COPY go.mod go.mod
1114
COPY go.sum go.sum
@@ -19,6 +22,14 @@ COPY . .
1922
# Build
2023
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -ldflags "${LDFLAGS} -extldflags '-static'" -a -o manager main.go
2124

25+
RUN if [ ${CRYPTO_LIB} ]; \
26+
then \
27+
CGO_ENABLED=1 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -ldflags "${LDFLAGS} -linkmode=external -extldflags '-static'" -a -o manager main.go ;\
28+
else \
29+
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -ldflags "${LDFLAGS} -extldflags '-static'" -a -o manager main.go ;\
30+
fi
31+
32+
2233
# Use distroless as minimal base image to package the manager binary
2334
# Refer to https://github.com/GoogleContainerTools/distroless for more details
2435
#FROM gcr.io/distroless/static:latest

0 commit comments

Comments
 (0)