-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #145 from cyberark/amd64-fips
CNJR-2699: Build FIPS binary with UBI toolchain for amd64
- Loading branch information
Showing
7 changed files
with
106 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
FROM registry.access.redhat.com/ubi9/ubi-minimal:latest as conjur-cli-go-builder | ||
|
||
ENV VERSION="" | ||
|
||
RUN microdnf update | ||
RUN microdnf install -y go-toolset git | ||
|
||
# Add the WORKDIR as a safe directory so git commands | ||
# can be run in containers using this image | ||
RUN git config --global --add safe.directory /github.com/cyberark/conjur-cli-go | ||
|
||
COPY builder_entrypoint.sh /builder_entrypoint.sh | ||
RUN chmod +x /builder_entrypoint.sh | ||
|
||
ENTRYPOINT ["/builder_entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -eo pipefail | ||
|
||
function main() { | ||
local OUTPUT_DIR | ||
OUTPUT_DIR='dist/fips' | ||
|
||
local SHORT_COMMIT_HASH | ||
SHORT_COMMIT_HASH="$(git rev-parse --short HEAD)" | ||
|
||
go mod tidy | ||
|
||
rm -rf "$OUTPUT_DIR" | ||
mkdir -p "$OUTPUT_DIR/conjur-cli-go_linux_amd64_v1" | ||
|
||
CGO_ENABLED=1 \ | ||
GOOS=linux \ | ||
GOARCH=amd64 \ | ||
GOEXPERIMENT=boringcrypto \ | ||
go build \ | ||
-ldflags "-w -X github.com/cyberark/conjur-cli-go/pkg/version.Tag=$SHORT_COMMIT_HASH -X main.version=${VERSION}" \ | ||
-o "$OUTPUT_DIR/conjur-cli-go_linux_amd64_v1/conjur" \ | ||
./cmd/conjur/main.go | ||
} | ||
|
||
main "$@" |