Skip to content

Commit 1051c52

Browse files
authored
Merge pull request #761 from spectrocloud/fips-static-link-fix-4.0
Fips changes for Static Linking
2 parents 05396d9 + cd7f621 commit 1051c52

File tree

2 files changed

+16
-8
lines changed

2 files changed

+16
-8
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: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# limitations under the License.
1616

1717
# Build the manager binary
18-
FROM golang:1.19.8 as toolchain
18+
FROM golang:1.19.10-alpine3.18 as toolchain
1919

2020
# Run this with docker build --build_arg $(go env GOPROXY) to override the goproxy
2121
ARG goproxy=https://proxy.golang.org
@@ -28,6 +28,9 @@ ENV GOEXPERIMENT=${CRYPTO_LIB:+boringcrypto}
2828
FROM toolchain as builder
2929
WORKDIR /workspace
3030

31+
RUN apk update
32+
RUN apk add git gcc g++ curl
33+
3134
# Copy the Go Modules manifests
3235
COPY go.mod go.mod
3336
COPY go.sum go.sum
@@ -44,10 +47,15 @@ COPY ./ ./
4447
ARG package=.
4548
ARG ARCH
4649
ARG LDFLAGS
47-
RUN --mount=type=cache,target=/root/.cache/go-build \
50+
RUN --mount=type=cache,target=/root/.cache/go-build \
4851
--mount=type=cache,target=/go/pkg/mod \
4952
--mount=type=cache,target=/root/.local/share/golang \
50-
CGO_ENABLED=0 GOOS=linux GOARCH=${ARCH} go build -ldflags "${LDFLAGS} -extldflags '-static'" -o manager ${package}
53+
if [ ${CRYPTO_LIB} ]; \
54+
then \
55+
CGO_ENABLED=1 GOOS=linux GOARCH=${ARCH} go build -ldflags "${LDFLAGS} -linkmode=external -extldflags '-static'" -o manager ${package}; \
56+
else \
57+
CGO_ENABLED=0 GOOS=linux GOARCH=${ARCH} go build -ldflags "${LDFLAGS} -extldflags '-static'" -o manager ${package}; \
58+
fi
5159
ENTRYPOINT [ "/start.sh", "/workspace/manager" ]
5260

5361
# Copy the controller-manager into a thin image

0 commit comments

Comments
 (0)