Last active
April 1, 2023 17:27
-
-
Save jmrepetti/7c49a9d2bc4ab534a6fbff7bc96a6381 to your computer and use it in GitHub Desktop.
Generate Rust project using Podman
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
podman run \ | |
-i `#Keep STDIN open even if not attached`\ | |
-t `#Allocate a pseudo-TTY for container`\ | |
--rm `#Remove container (and pod if created) after exit`\ | |
-e CARGO_HOME=./cargo `#persist registry within project`\ | |
-v ./:/new_rust_project `#Bind mount a volume into the container`\ | |
--security-opt label=disable `#allow me to write on mounted volume`\ | |
-w /new_rust_project `#Working directory inside the container`\ | |
--name rust_cmd `#Assign a name to the container`\ | |
rust `#IMAGE`\ | |
$@ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Save snippet to cargo.sh file and give +x permissions.
Change 'new_rust_project' with your preferred name.
USAGE:
You can mount your existing cargo registry with: