-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
If that inspires anything:
$ cargo fetch && podman run --rm -it --mount type=bind,source="$(pwd)"/,target=/build,rw --mount type=bind,source="${HOME}"/.cargo/git,target=/usr/local/cargo/git,ro --mount type=bind,source="${HOME}"/.cargo/registry,target=/usr/local/cargo/registry,ro --network none -w /build rust cargo build --offline
Replace podman
by sudo docker
if you want docker
.
Replace rust
with a suitable container image if your Rust project or any of its dependencies require additional dependencies.
- Mounts
$HOME/cargo/git
and$HOME/cargo/registry
as readonly for passing in source dependencies (only git and registry dependencies supported.) - Mounts the current directory as readwrite for passing in sources and passing out build artifacts
I could set this as an alias on my system to perform sandboxed builds.
Metadata
Metadata
Assignees
Labels
No labels