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

Podman/Docker ad-hoc sandbox #8

Open
llebout opened this issue Nov 26, 2019 · 0 comments
Open

Podman/Docker ad-hoc sandbox #8

llebout opened this issue Nov 26, 2019 · 0 comments

Comments

@llebout
Copy link

llebout commented Nov 26, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant