为镜像添加SSH服务
一、基于commit命令创建
1.1 下载镜像
$docker pull ubuntu:18.04 $docker run -it ubuntu:18.04 bash
1.2 更新软件源
:/# apt-get update
1.3 添加国内源
:/# vi /etc/apt/sources.list.d/aliyun.list #添加如下内容 deb http://mirrors.aliyun.com/ubuntu/ trusty main multiverse restricted universe deb http://mirrors.aliyun.com/ubuntu/ trusty-backports main multiverse restricted universe deb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main multiverse restricted universe deb http://mirrors.aliyun.com/ubuntu/ trusty-security main multiverse restricted universe deb http://mirrors.aliyun.com/ubuntu/ trusty-updates main multiverse restricted universe deb-src http://mirrors.aliyun.com/ubuntu/ trusty main multiverse restricted universe deb-src http://mirrors.aliyun.com/ubuntu/ trusty-backports main multiverse restricted universe deb-src http://mirrors.aliyun.com/ubuntu/ trusty-proposed main multiverse restricted universe deb-src http://mirrors.aliyun.com/ubuntu/ trusty-security main multiverse restricted universe deb-src http://mirrors.aliyun.com/ubuntu/ trusty-updates main multiverse restricted universe :/# apt-get update
添加路由
Route add -net 192.168.0.0/24 gw 192.168.0.1
Route add -host 192.168.0.1 dev 192.168.0.1
删除路由
Route del -net 192.168.0.0/24 gw 192.168.0.1
查看容器IP
docker inspect mycentos2
docker inspect --format=‘{{.NetworkSettings.IPAddress}}‘ mycentos2
docker启动报错
删除/etc/docker/daemon.json文件
https://www.cnblogs.com/cocowool/p/docker_daemon_log_driver.html
碰到点问题,先记录一下,待会在整理
1.4 安装配置SSH服务
相关推荐
WanKaShing 2020-11-12
projava 2020-11-14
airfish000 2020-09-11
tryfind 2020-09-14
yegen00 2020-09-10
kkaazz 2020-09-03
风语者 2020-09-02
BraveWangDev 2020-08-19
lichuanlong00 2020-08-15
gsl 2020-08-15
pandaphinex 2020-08-09
yhuihon 2020-08-09
CheNorton 2020-08-02
xiangqiao 2020-07-28
hpujsj 2020-07-26
hpujsj 2020-07-26
sshong 2020-07-19
BraveWangDev 2020-07-19
annan 2020-07-18