mirror of
https://github.com/addnab/docker-run-action.git
synced 2025-01-14 16:47:58 +08:00
fix: check if network exists
This commit is contained in:
parent
6321bad333
commit
f451fad679
@ -1,8 +1,7 @@
|
|||||||
# Docker Run Action
|
# Docker Run Action
|
||||||
|
|
||||||
- run a privately-owned image.
|
|
||||||
- run an image built by a previous step.
|
|
||||||
- run a specific step in docker.
|
- run a specific step in docker.
|
||||||
|
- run an image built by a previous step.
|
||||||
- See https://github.com/addnab/docker-run-action/blob/main/action.yml for all the available inputs.
|
- See https://github.com/addnab/docker-run-action/blob/main/action.yml for all the available inputs.
|
||||||
|
|
||||||
#### Typical Use Case
|
#### Typical Use Case
|
||||||
|
@ -6,4 +6,8 @@ fi
|
|||||||
|
|
||||||
echo "$INPUT_RUN" | sed -e 's/\\n/;/g' > semicolon_delimited_script
|
echo "$INPUT_RUN" | sed -e 's/\\n/;/g' > semicolon_delimited_script
|
||||||
|
|
||||||
exec docker run -v "/var/run/docker.sock":"/var/run/docker.sock" --network=$INPUT_DOCKER_NETWORK $INPUT_OPTIONS --entrypoint=$INPUT_SHELL $INPUT_IMAGE -c "`cat semicolon_delimited_script`"
|
if [ ! -z $INPUT_DOCKER_NETWORK ];
|
||||||
|
then INPUT_OPTIONS="$INPUT_OPTIONS --network $INPUT_DOCKER_NETWORK"
|
||||||
|
fi
|
||||||
|
|
||||||
|
exec docker run -v "/var/run/docker.sock":"/var/run/docker.sock" $INPUT_OPTIONS --entrypoint=$INPUT_SHELL $INPUT_IMAGE -c "`cat semicolon_delimited_script`"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user