ssh-action icon indicating copy to clipboard operation
ssh-action copied to clipboard

Run script in a docker container

Open ghnp5 opened this issue 1 year ago • 2 comments

Hey! Is it possible to run the script in a docker container?

In other words - connect with SSH to remote server, then spin up container with image name provided and a list of volumes mounted, and then execute the script inside that container.

Is it possible with this action?

If not, then this is a feature request 😊

Many thanks!

ghnp5 avatar Jan 09 '25 21:01 ghnp5

Bug fix

SoeAung95 avatar Jan 16 '25 05:01 SoeAung95

Could you please explain the context in which this requirement will be used?

appleboy avatar Jan 21 '25 07:01 appleboy

Hi! The idea is to provide some isolation/security.

For example, by mounting a number of "read-only" volumes, and only one "write" volume. If something goes wrong with the script, the harm will be limited.

For now, I'm doing it manually:

  1. use ssh-action
  2. cat <<<'EOF' to /tmp/script.sh
  3. docker run ... -v ... -v ... sh /tmp/script.sh
  4. delete /tmp/script.sh

But ideally, it would be nice to be able to do this using the ssh-action directly :)

Thanks!

ghnp5 avatar Jan 21 '25 12:01 ghnp5