Create a remote docker container

2016-12-28  本文已影响0人  高亢

desktop

ssh-keygen -t rsa

scp /root/.ssh/id_rsa.pub root@$ip:/root/$file

remote

docker run -it -v /root:/root/hr $container_tags /bin/bash

remote docker

cp /root/hr/$FILENAME /root/.ssh/authorized_keys

remote

docker commit $container_id $container_tags

docker run -d -v /root:/root/hr -p 51022:22 -p 51080:80 $container_tags /usr/sbin/sshd -D

desktop

ssh root@$ip -p 51022
上一篇 下一篇

猜你喜欢

热点阅读