启动一个Ubuntu 容器 (常用语行容器构建时安装测试)

  1. __ubuntu() {
  2. docker rm -f ubuntu
  3. docker pull registry.cn-hangzhou.aliyuncs.com/lwmacct/ubuntu:v3
  4. docker run -itd --name=ubuntu \
  5. --restart=always \
  6. --privileged \
  7. -v /proc:/host/:ro \
  8. -v /data/docker-share/:/kuaicdn/share/ \
  9. -v /data/docker-data/ubuntu/:/kuaicdn/data \
  10. registry.cn-hangzhou.aliyuncs.com/lwmacct/ubuntu:v3
  11. }
  12. __ubuntu
  13. docker exec -it ubuntu bash

Docker Ubuntu 启用ssh

设置运行root 用户登录

  1. sed -i 's,^#PermitRootLogin.*$,PermitRootLogin yes,' /etc/ssh//sshd_config; \

启动 sshd

  1. /etc/init.d/ssh start