Skip to content

Podman/Docker ad-hoc sandbox #8

@llebout

Description

@llebout

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions