parent 358af5c600
author Yossi Farjoun <farjoun@broadinstitute.org> 1617479686 -0400 committer Yossi Farjoun <farjoun@broadinstitute.org> 1618455120 -0400 Change the way the script is run. instead of modfying the ENTRYPOINT, we will simply add the "shell" (default sh) and the "script_prefix" (default -c) and then the script. That way the possible comple entry point is not disturbed. if a user would like to remove the ENTRYPOINT they can provide an "option" "--entrypoint ''" for example.
This commit is contained in:
parent
358af5c600
commit
b9fe748ee2
4 changed files with 7 additions and 3 deletions
2
.github/workflows/tests.yml
vendored
2
.github/workflows/tests.yml
vendored
|
@ -3,7 +3,7 @@ name: Docker Run Action Tests
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- '**'
|
||||||
pull_request:
|
pull_request:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
|
@ -55,4 +55,4 @@
|
||||||
run: |
|
run: |
|
||||||
echo "first line"
|
echo "first line"
|
||||||
echo "second line"
|
echo "second line"
|
||||||
```
|
|
||||||
|
|
|
@ -15,6 +15,10 @@ inputs:
|
||||||
description: 'Use a specific shell'
|
description: 'Use a specific shell'
|
||||||
required: false
|
required: false
|
||||||
default: sh
|
default: sh
|
||||||
|
script_prefix:
|
||||||
|
description: 'a prefix telling the shell to execute the following (single) string as a script'
|
||||||
|
required: false
|
||||||
|
default: -c
|
||||||
registry:
|
registry:
|
||||||
description: 'Registry'
|
description: 'Registry'
|
||||||
required: false
|
required: false
|
||||||
|
|
|
@ -8,4 +8,4 @@ if [ ! -z $INPUT_DOCKER_NETWORK ];
|
||||||
then INPUT_OPTIONS="$INPUT_OPTIONS --network $INPUT_DOCKER_NETWORK"
|
then INPUT_OPTIONS="$INPUT_OPTIONS --network $INPUT_DOCKER_NETWORK"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exec docker run -v "/var/run/docker.sock":"/var/run/docker.sock" $INPUT_OPTIONS --entrypoint=$INPUT_SHELL $INPUT_IMAGE -c "${INPUT_RUN//$'\n'/;}"
|
exec docker run -v "/var/run/docker.sock":"/var/run/docker.sock" $INPUT_OPTIONS $INPUT_IMAGE $INPUT_SHELL $INPUT_SCRIPT_PREFIX "${INPUT_RUN//$'\n'/;}"
|
||||||
|
|
Reference in a new issue