diff options
Diffstat (limited to 'contrib')
-rwxr-xr-x | contrib/create_container | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/contrib/create_container b/contrib/create_container index 87c4f82..01fc835 100755 --- a/contrib/create_container +++ b/contrib/create_container @@ -64,9 +64,26 @@ docker run \ -v $XDTDIR:/xdt \ -it $IMAGE -echo "Copying your identity to container $NAME:" -sleep 5 -ssh-copy-id -p $SSH_PORT devel@$(hostname) +echo "Copying your identity to container $NAME" +#wait ssh service +echo -n wait ssh service . +res=3 +max=30 +count=0 +while [ $res -ne 0 ] && [ $count -le $max ]; do + sleep 1 + docker exec ${NAME} bash -c "systemctl status ssh" 2>/dev/null 1>&2 + res=$? + echo -n "." + count=$(expr $count + 1); +done +echo + +ssh-keygen -R [$(hostname)]:$SSH_PORT -f ~/.ssh/known_hosts +docker exec ${NAME} bash -c "mkdir -p /home/devel/.ssh" +docker cp ~/.ssh/id_rsa.pub ${NAME}:/home/devel/.ssh/authorized_keys +docker exec ${NAME} bash -c "chown devel:devel -R /home/devel/.ssh ;chmod 0700 /home/devel/.ssh;chmod 0600 /home/devel/.ssh/*" +ssh -o StrictHostKeyChecking=no -p $SSH_PORT devel@$(hostname) exit echo "You can now login using:" echo " ssh -p $SSH_PORT devel@$(hostname)" |