1. 建立Docker映射到端口号8888
docker run -it -p 8888:22 --runtime=nvidia -v /local_path:/map_path IMAGEID /bin/bash
cd /etc/ssh/
apt-get install openssh-server
vim sshd_config
2. 更改密码,设置开机自启
passwd root
vim ~/.bashrc
service ssh start
3. 服务器设置开机自启
vim ~/.bashrc
docker start ID
4. 重启docker
sudo systemctl daemon-reload
sudo systemctl restart docker