add run-remote: rsync an image to a target and run it
This commit is contained in:
parent
41fc678b69
commit
44ac3694cb
1 changed files with 13 additions and 0 deletions
13
run-remote
Executable file
13
run-remote
Executable file
|
|
@ -0,0 +1,13 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
IMAGE="$1"
|
||||||
|
shift
|
||||||
|
|
||||||
|
TARGET="$1"
|
||||||
|
shift
|
||||||
|
|
||||||
|
IMAGE_BASENAME=$(basename "${IMAGE}")
|
||||||
|
docker save -o "/tmp/${IMAGE_BASENAME}" "${IMAGE}"
|
||||||
|
rsync -av --progress "/tmp/${IMAGE_BASENAME}" "${IMAGE}/run.sh" "${TARGET}:/tmp"
|
||||||
|
ssh "${TARGET}" docker load -i "/tmp/${IMAGE_BASENAME}"
|
||||||
|
ssh -t "${TARGET}" /tmp/run.sh $@
|
||||||
Loading…
Add table
Add a link
Reference in a new issue