feat: support docker image tarballs

This commit is contained in:
Brock Allen
2024-02-02 17:13:04 -08:00
parent 3e77f186b7
commit 7fff0e1b7b
2 changed files with 7 additions and 0 deletions

View File

@@ -2,6 +2,9 @@
name: 'Docker Run Action'
description: 'Run a command in a new container'
inputs:
tarball:
description: 'Image tarball'
required: false
image:
description: 'Image'
required: true

View File

@@ -8,4 +8,8 @@ if [ ! -z $INPUT_DOCKER_NETWORK ];
then INPUT_OPTIONS="$INPUT_OPTIONS --network $INPUT_DOCKER_NETWORK"
fi
if [ ! -z $INPUT_TARBALL ];
then docker load --input $INPUT_TARBALL
fi
exec docker run -v "/var/run/docker.sock":"/var/run/docker.sock" $INPUT_OPTIONS --entrypoint=$INPUT_SHELL $INPUT_IMAGE -c "${INPUT_RUN//$'\n'/;}"