Skip to content

Commit 8a53140

Browse files
committed
Build the binary inside the chosen base image.
1 parent e131224 commit 8a53140

1 file changed

Lines changed: 20 additions & 3 deletions

File tree

.github/workflows/docker.yml

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,28 @@ jobs:
3838
with:
3939
ref: ${{ github.event_name == 'workflow_dispatch' && inputs.ref || github.ref }}
4040

41-
- name: Install build dependencies
42-
run: sudo apt-get update && sudo apt-get install -y --no-install-recommends libudev-dev libdbus-1-dev
41+
- name: Resolve rust image
42+
run: |
43+
rust_image="${{ github.event_name == 'workflow_dispatch' && inputs.rust_image || 'latest' }}"
44+
echo "RUST_IMAGE=${rust_image}" >> "$GITHUB_ENV"
4345
46+
# Build inside the rust_image container so the binary's glibc and linked
47+
# libraries match the runtime base image. Each matrix runner is native
48+
# arch, so docker pulls the matching variant from the multi-arch manifest
49+
# — no QEMU emulation.
4450
- name: Build binary
45-
run: cargo build --package stellar-cli --release
51+
run: |
52+
docker run --rm \
53+
-v "$(pwd):/src" \
54+
-w /src \
55+
"rust:${RUST_IMAGE}" \
56+
sh -c "
57+
apt-get update && \
58+
apt-get install -y --no-install-recommends \
59+
build-essential cmake pkg-config \
60+
libssl-dev libudev-dev libdbus-1-dev && \
61+
cargo build --package stellar-cli --release
62+
"
4663
4764
- name: Upload binary
4865
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1

0 commit comments

Comments
 (0)