Skip to content

Commit

Permalink
Move to official Rust Alpine Docker image
Browse files Browse the repository at this point in the history
The previous image appears to be mostly unmaintained:
emk/rust-musl-builder#147
  • Loading branch information
shepmaster committed Nov 20, 2022
1 parent dacb49a commit 357d0b4
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -194,17 +194,17 @@ jobs:
args: "--manifest-path top-crates/Cargo.toml --check"
- name: Build backend
run: |-
mkdir -p ui/target; docker run --rm -v $PWD/ui:/ui -v ~/.cargo/git:/home/rust/.cargo/git -v ~/.cargo/registry:/home/rust/.cargo/registry --workdir /ui ekidd/rust-musl-builder:stable bash -c $'
sudo chown -R rust:rust /home/rust/.cargo /ui/target;
mkdir -p ui/target; docker run --rm -v $PWD/ui:/ui -v ~/.cargo/git:/root/.cargo/git -v ~/.cargo/registry:/root/.cargo/registry --workdir /ui rust:alpine bash -c '
apk add musl-dev openssl-dev
# Unit tests
cargo test --locked --target=x86_64-unknown-linux-musl --no-run;
test_bin=$(find target/x86_64-unknown-linux-musl/debug/deps/ -type f -perm -a=x);
cargo test --locked --no-run;
test_bin=$(find target/debug/deps/ -type f -perm -a=x);
mv "${test_bin}" target/unit_tests;
# Primary binary
cargo build --locked --target=x86_64-unknown-linux-musl --release;
mv target/x86_64-unknown-linux-musl/release/ui target/ui;
cargo build --locked --release;
mv target/release/ui target/ui;
'
- name: Restore permissions
run: sudo chown -R runner:docker ~/.cargo/ ui/target
Expand Down
18 changes: 9 additions & 9 deletions ci/workflows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -298,21 +298,21 @@ workflows:
run
--rm
-v $PWD/ui:/ui
-v ~/.cargo/git:/home/rust/.cargo/git
-v ~/.cargo/registry:/home/rust/.cargo/registry
-v ~/.cargo/git:/root/.cargo/git
-v ~/.cargo/registry:/root/.cargo/registry
--workdir /ui
ekidd/rust-musl-builder:stable
bash -c $'
sudo chown -R rust:rust /home/rust/.cargo /ui/target;
rust:alpine
bash -c '
apk add musl-dev openssl-dev
# Unit tests
cargo test --locked --target=x86_64-unknown-linux-musl --no-run;
test_bin=$(find target/x86_64-unknown-linux-musl/debug/deps/ -type f -perm -a=x);
cargo test --locked --no-run;
test_bin=$(find target/debug/deps/ -type f -perm -a=x);
mv "${test_bin}" target/unit_tests;
# Primary binary
cargo build --locked --target=x86_64-unknown-linux-musl --release;
mv target/x86_64-unknown-linux-musl/release/ui target/ui;
cargo build --locked --release;
mv target/release/ui target/ui;
'
- name: "Restore permissions"
Expand Down

0 comments on commit 357d0b4

Please sign in to comment.