summaryrefslogtreecommitdiff
path: root/start-container-qemu.sh
diff options
context:
space:
mode:
authorChristophe Lyon <christophe.lyon@linaro.org>2018-05-23 12:38:01 +0000
committerChristophe Lyon <christophe.lyon@linaro.org>2018-05-24 11:12:32 +0000
commit9f1aa0bc554f1ec64925f81a495e56324692efa1 (patch)
treed37bb7a06b316a973dec0d6e806df2b8af1b8bf3 /start-container-qemu.sh
parent4c02c369a6b703610cdd070a51531b9cdbd26874 (diff)
Connect to docker via ssh rather than directly to port 2375.
This allows to manage containers using ssh only, the docker port does not need to be open to external connections. This allows to start containers on hosts outside of the lan. Basically it is a matter of changing: -DOCKER="docker -H $docker_host:2375" +DOCKER="ssh $docker_host docker" in jenkins-helpers.sh, start-container-docker.sh and start-container-qemu.sh. Change-Id: I1051896521ee47640cdeefc9eed3324661ee0a9f
Diffstat (limited to 'start-container-qemu.sh')
-rwxr-xr-xstart-container-qemu.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/start-container-qemu.sh b/start-container-qemu.sh
index bd7ef52e..e007cefe 100755
--- a/start-container-qemu.sh
+++ b/start-container-qemu.sh
@@ -54,7 +54,7 @@ nfsroot="/tmp/nfsroot"
container_exec sudo mkdir "$nfsroot"
container_exec sudo rsync -a --one-file-system / $nfsroot/
-nfsip=$(docker -H $host:2375 inspect --format {{.NetworkSettings.IPAddress}} "$container_id")
+nfsip=$(ssh $host docker inspect --format {{.NetworkSettings.IPAddress}} "$container_id")
# Start NFS server inside container.
# Note, for NFS server to work inside container kernel should have
@@ -102,7 +102,7 @@ remote_exec "$host:$port:/:-f -Snone" \
-device virtio-net-device,netdev=unet \
-s > ${prefix}qemu.log 2>&1
-qemu_port=$(docker -H $host:2375 port $container_id 2222 | cut -d: -f 2)
+qemu_port=$(ssh $host docker port $container_id 2222 | cut -d: -f 2)
ret=0
wait_for_ssh_server $host $qemu_port || ret=$?