-
Notifications
You must be signed in to change notification settings - Fork 173
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow for the injector to be built in docker (#1917)
## Description This PR allows building the injector on more systems and migrates its release to GHCR to avoid issues with Docker Hub. ## Related Issue Fixes #N/A ## Type of change - [ ] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [X] Other (security config, docs update, etc) ## Checklist before merging - [X] Test, docs, adr added or updated as needed - [X] [Contributor Guide Steps](https://github.com/defenseunicorns/zarf/blob/main/CONTRIBUTING.md#developer-workflow) followed
- Loading branch information
Showing
9 changed files
with
88 additions
and
52 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
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1 +1,3 @@ | ||
target/ | ||
aarch64-linux-musl-cross/ | ||
x86_64-linux-musl-cross/ |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,41 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# SPDX-FileCopyrightText: 2021-Present The Zarf Authors | ||
|
||
.PHONY: help | ||
help: ## Display this help information | ||
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) \ | ||
| sort | awk 'BEGIN {FS = ":.*?## "}; \ | ||
{printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' | ||
|
||
clean: ## Clean the build directory | ||
rm -rf target | ||
|
||
build-injector-linux: build-injector-linux-amd build-injector-linux-arm ## Build the Zarf injector for AMD64 and ARM64 | ||
|
||
build-injector-linux-amd: ## Build the Zarf injector for AMD64 | ||
rustup target add x86_64-unknown-linux-musl | ||
|
||
if [ "$(shell uname -m)" = "arm64" ] || [ "$(shell uname -m)" = "aarch64" ]; then \ | ||
test -s x86_64-linux-musl-cross || curl https://zarf-public.s3-us-gov-west-1.amazonaws.com/pipelines/x86_64-linux-musl-cross.tgz | tar -xz; \ | ||
export PATH="$$PWD/x86_64-linux-musl-cross/bin:$$PATH"; \ | ||
export CARGO_TARGET_X86_64_UNKNOWN_LINUX_MUSL_LINKER=x86_64-linux-musl-cc; \ | ||
cargo build --target x86_64-unknown-linux-musl --release; \ | ||
elif [ "$(shell uname -m)" = "x86_64" ]; then \ | ||
cargo build --target x86_64-unknown-linux-musl --release; \ | ||
fi | ||
|
||
du --si target/x86_64-unknown-linux-musl/release/zarf-injector | ||
|
||
build-injector-linux-arm: ## Build the Zarf injector for ARM64 | ||
rustup target add aarch64-unknown-linux-musl | ||
|
||
if [ "$(shell uname -m)" = "arm64" ] || [ "$(shell uname -m)" = "aarch64" ]; then \ | ||
cargo build --target aarch64-unknown-linux-musl --release; \ | ||
elif [ "$(shell uname -m)" = "x86_64" ]; then \ | ||
test -s aarch64-linux-musl-cross || curl https://zarf-public.s3-us-gov-west-1.amazonaws.com/pipelines/aarch64-linux-musl-cross.tgz | tar -xz; \ | ||
export PATH="$$PWD/aarch64-linux-musl-cross/bin:$$PATH"; \ | ||
export CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_LINKER=aarch64-linux-musl-cc; \ | ||
cargo build --target aarch64-unknown-linux-musl --release; \ | ||
fi | ||
|
||
du --si target/aarch64-unknown-linux-musl/release/zarf-injector |
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