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 4bb2ba9cbe Initial commit 3 years ago
.atom-build.yml 4bb2ba9cbe Initial commit 3 years ago
README.md 4bb2ba9cbe Initial commit 3 years ago
podmanRun 4bb2ba9cbe Initial commit 3 years ago
test.sh 4bb2ba9cbe Initial commit 3 years ago

README.md

USAGE
    podmanRun [-m MODE] [-o OPTIONS] [COMMANDS [ARGS]...] [--help] [--debug]

COMMANDS
    COMMANDS to run in the container

OPTIONS
    --mode, -m MODE
        1. recreate (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