From 7fff0e1b7b16d3753dad54872a19fb0e6c2e533e Mon Sep 17 00:00:00 2001 From: Brock Allen Date: Fri, 2 Feb 2024 17:13:04 -0800 Subject: [PATCH] feat: support docker image tarballs --- action.yml | 3 +++ entrypoint.sh | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/action.yml b/action.yml index 7c1a8e6..5835bcd 100644 --- a/action.yml +++ b/action.yml @@ -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 diff --git a/entrypoint.sh b/entrypoint.sh index 39c1d70..184c292 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -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'/;}"