Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: Produce statically-linked images with musl #440

Merged
merged 1 commit into from
May 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,10 @@ jobs:
PACKAGE_VERSION: ${{ needs.meta.outputs.version }}
CARGO_RELEASE: "1"
DEBIAN_FRONTEND: noninteractive
container: docker://ghcr.io/linkerd/dev:v43-rust
container: docker://ghcr.io/linkerd/dev:v43-rust-musl
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- run: git config --global --add safe.directory "$PWD" # actions/runner#2033
- run: just rustup
if: matrix.arch != 'amd64'
- run: apt-get update && apt-get install -y g++-aarch64-linux-gnu gcc-aarch64-linux-gnu libc6-dev-arm64-cross
if: matrix.arch == 'arm64'
- run: apt-get update && apt-get install -y g++-arm-linux-gnueabihf gcc-arm-linux-gnueabihf libc6-dev-armhf-cross
if: matrix.arch == 'arm'
- run: just release
- uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32
with:
Expand Down
10 changes: 4 additions & 6 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ package_arch := env_var_or_default("ARCH", "amd64")
# If a `package_arch` is specified, then we change the default cargo `--target`
# to support cross-compilation. Otherwise, we use `rustup` to find the default.
_cargo_target := if package_arch == "amd64" {
"x86_64-unknown-linux-gnu"
"x86_64-unknown-linux-musl"
} else if package_arch == "arm64" {
"aarch64-unknown-linux-gnu"
"aarch64-unknown-linux-musl"
} else if package_arch == "arm" {
"armv7-unknown-linux-gnueabihf"
"armv7-unknown-linux-musleabihf"
} else {
`rustup show | sed -n 's/^Default host: \(.*\)/\1/p'`
}
Expand Down Expand Up @@ -149,9 +149,7 @@ test *flags:

# Build linkerd-await
build:
{{ _cargo }} build --frozen --target={{ _cargo_target }} \
{{ if build_type == "release" { "--release" } else { "" } }} \
{{ _fmt }}
just-cargo profile={{ build_type }} target={{ _cargo_target }} build

release: fetch build
@mkdir -p release
Expand Down
Loading