A podman run/exec wrapper to automatically handle container creation, removal, and reuse https://blog.bryanroessler.com/2020-05-15-podmanrun-a-simple-podman-wrapper/
bryan 206fa6df03 Update README | 4 년 전 | |
---|---|---|
.atom-build.yml | 4 년 전 | |
README.md | 4 년 전 | |
podmanRun | 4 년 전 | |
test.sh | 4 년 전 |
For a complete list of up-to-date options use podmanRun --help
.
You can also find more information on my blog.
USAGE
podmanRun [-m MODE] [-o OPTIONS] [COMMANDS [ARGS]...] [--help] [--debug]
COMMANDS
COMMANDS to run in the container
OPTIONS
--mode, -m MODE
1. recreate (default) (remove container if it already exists and create a new one)
2. persistent (reuse existing container if it exists)
--options, -o OPTIONS
OPTIONS to pass to podman run/exec
Can be passed multiple times to concatenate
Will be split on whitespace
Final option should be the name of the container image
--debug, -d
Print debugging
--help, -h
Print this help message and exit
EXAMPLES
Note: IDE examples are using Atom Build package placeholders.
Run an ephemeral PHP webserver container using the current directory as webroot:
podmanRun -o "-p=8000:80 --name=php_script -v=$PWD:/var/www/html:z php:7.3-apache"
Run an ephemeral PHP webserver container using the current directory as webroot using IDE:
podmanRun -o "-p=8000:80 --name=php_{FILE_ACTIVE_NAME_BASE} \
-v={FILE_ACTIVE_PATH}:/var/www/html:z php:7.3-apache"
Run an ephemeral bash script:
podmanRun -o "--name=bash_script -v=$PWD:$PWD:z -w=$PWD debian:testing" ./script.sh
Run an ephemeral bash script using IDE:
podmanRun -o "--name=bash_{FILE_ACTIVE_NAME_BASE}" \
-o "-v={FILE_ACTIVE_PATH}:{FILE_ACTIVE_PATH}:z"
-o "-w={FILE_ACTIVE_PATH}" \
-o "debian:testing" \
{FILE_ACTIVE} arg1 arg2