fix(ci): build static natively with musl on the build host (drop container-build)
CI / Build Native (push) Failing after 6m7s
CI / Build Native (push) Failing after 6m7s
container-build=true runs the native-image inside a Mandrel container, but in the act runner the workspace mount doesn't resolve (/workspace/... is a container path, not a host path), so the Mandrel container can't see shot-crafter-calculator-1.0.0-runner.jar. Fix: install musl + musl-tools in the CI container, build locally. Quarkus 3.x's binary-type=STATIC will then produce a genuinely static binary linked against musl, which has no dependency on the host's glibc and runs cleanly on quarkus-micro-image:2.0 (UBI 9, glibc 2.34).
This commit is contained in:
@@ -21,10 +21,10 @@ jobs:
|
|||||||
image: maven:3.9.6-eclipse-temurin-21
|
image: maven:3.9.6-eclipse-temurin-21
|
||||||
options: --memory=8g
|
options: --memory=8g
|
||||||
steps:
|
steps:
|
||||||
- name: Install git, node, gcc, docker, buildx, and basic tools
|
- name: Install git, node, gcc, musl, docker, buildx, and basic tools
|
||||||
run: |
|
run: |
|
||||||
apt-get update
|
apt-get update
|
||||||
apt-get install -y git curl ca-certificates build-essential zlib1g-dev docker.io docker-buildx
|
apt-get install -y git curl ca-certificates build-essential zlib1g-dev musl musl-tools docker.io docker-buildx
|
||||||
curl -fsSL https://deb.nodesource.com/setup_22.x | bash -
|
curl -fsSL https://deb.nodesource.com/setup_22.x | bash -
|
||||||
apt-get install -y nodejs
|
apt-get install -y nodejs
|
||||||
rm -rf /var/lib/apt/lists/*
|
rm -rf /var/lib/apt/lists/*
|
||||||
@@ -33,6 +33,7 @@ jobs:
|
|||||||
gcc --version
|
gcc --version
|
||||||
docker --version
|
docker --version
|
||||||
docker buildx version
|
docker buildx version
|
||||||
|
musl-gcc --version 2>/dev/null || echo "musl-gcc not present (binary-type=STATIC won't produce static binaries)"
|
||||||
|
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
@@ -61,7 +62,7 @@ jobs:
|
|||||||
restore-keys: ${{ runner.os }}-node-
|
restore-keys: ${{ runner.os }}-node-
|
||||||
|
|
||||||
- name: Build (Native)
|
- name: Build (Native)
|
||||||
run: mvn package -Pnative -B -DskipTests -Dquarkus.native.native-image-xmx=4g -Dquarkus.native.binary-type=STATIC -Dquarkus.native.container-build=true
|
run: mvn package -Pnative -B -DskipTests -Dquarkus.native.native-image-xmx=4g -Dquarkus.native.binary-type=STATIC
|
||||||
|
|
||||||
- name: Verify native binary
|
- name: Verify native binary
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
Reference in New Issue
Block a user