Compare commits
4 Commits
4bb2ba9cbe
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 206fa6df03 | |||
| 5acb2d3b91 | |||
| 3c645bee63 | |||
| dcb4dd8a65 |
@@ -1,3 +1,7 @@
|
|||||||
|
For a complete list of up-to-date options use `podmanRun --help`.
|
||||||
|
|
||||||
|
You can also find more information [on my blog](https://blog.bryanroessler.com/2020-05-15-podmanrun-a-simple-podman-wrapper/).
|
||||||
|
|
||||||
```text
|
```text
|
||||||
USAGE
|
USAGE
|
||||||
podmanRun [-m MODE] [-o OPTIONS] [COMMANDS [ARGS]...] [--help] [--debug]
|
podmanRun [-m MODE] [-o OPTIONS] [COMMANDS [ARGS]...] [--help] [--debug]
|
||||||
@@ -7,7 +11,7 @@ COMMANDS
|
|||||||
|
|
||||||
OPTIONS
|
OPTIONS
|
||||||
--mode, -m MODE
|
--mode, -m MODE
|
||||||
1. recreate (remove container if it already exists and create a new one)
|
1. recreate (default) (remove container if it already exists and create a new one)
|
||||||
2. persistent (reuse existing container if it exists)
|
2. persistent (reuse existing container if it exists)
|
||||||
--options, -o OPTIONS
|
--options, -o OPTIONS
|
||||||
OPTIONS to pass to podman run/exec
|
OPTIONS to pass to podman run/exec
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
# shellcheck disable=SC1090,SC2004
|
|
||||||
#
|
#
|
||||||
# This script/function is a wrapper for podman run/exec that will automatically handle container
|
# This script/function is a wrapper for podman run/exec that will automatically handle container
|
||||||
# creation, removal, and reuse
|
# creation, removal, and reuse
|
||||||
@@ -38,7 +37,7 @@ COMMANDS
|
|||||||
|
|
||||||
OPTIONS
|
OPTIONS
|
||||||
--mode, -m MODE
|
--mode, -m MODE
|
||||||
1. recreate (remove container if it already exists and create a new one)
|
1. recreate (default) (remove container if it already exists and create a new one)
|
||||||
2. persistent (reuse existing container if it exists)
|
2. persistent (reuse existing container if it exists)
|
||||||
--options, -o OPTIONS
|
--options, -o OPTIONS
|
||||||
OPTIONS to pass to podman run/exec
|
OPTIONS to pass to podman run/exec
|
||||||
@@ -65,7 +64,7 @@ EXAMPLES
|
|||||||
|
|
||||||
Run an ephemeral bash script using IDE:
|
Run an ephemeral bash script using IDE:
|
||||||
podmanRun -o "--name=bash_{FILE_ACTIVE_NAME_BASE}" \
|
podmanRun -o "--name=bash_{FILE_ACTIVE_NAME_BASE}" \
|
||||||
-o "-v={FILE_ACTIVE_PATH}:{FILE_ACTIVE_PATH}:z"
|
-o "-v={FILE_ACTIVE_PATH}:{FILE_ACTIVE_PATH}:z" \
|
||||||
-o "-w={FILE_ACTIVE_PATH}" \
|
-o "-w={FILE_ACTIVE_PATH}" \
|
||||||
-o "debian:testing" \
|
-o "debian:testing" \
|
||||||
{FILE_ACTIVE} arg1 arg2
|
{FILE_ACTIVE} arg1 arg2
|
||||||
@@ -208,8 +207,8 @@ EOF
|
|||||||
# Run or execute container
|
# Run or execute container
|
||||||
_runContainer "$_cname"
|
_runContainer "$_cname"
|
||||||
|
|
||||||
# Cleanup more reliably
|
# Cleanup more reliably (usually not necessary)
|
||||||
[[ "$_mode" == "recreate" ]] && _containerExists "$_cname" && _removeContainer "$_cname"
|
#[[ "$_mode" == "recreate" ]] && _containerExists "$_cname" && _removeContainer "$_cname"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Allow this function to be executed directly
|
# Allow this function to be executed directly
|
||||||
|
|||||||
Reference in New Issue
Block a user