1、错误
创建镜像时候报错
WARNING: IPv4 forwarding is disabled. Networking will not work.
2、解决方案:
2.1、修改sysctl.conf,添加ipv4转发为打开状态:
sudo vim /etc/sysctl.conf
net.ipv4.ip_forward=1
2.2、重启网卡吗,使之生效:
systemctl restart network
在docker的宿主机中更改以下
[root@localhost ~]# vi /usr/lib/sysctl.d/00-system.conf
添加如下代码:
net.ipv4.ip_forward=1
重启network服务
# systemctl restart network
以前是0
在安装iptables
https://www.cnblogs.com/shikyoh/p/10684040.html
service iptables status
#安装iptables
yum install -y iptables
#安装iptables-services
yum install iptables-services
#注册iptables服务
#相当于以前的chkconfig iptables on
systemctl enable iptables.service
#开启服务
systemctl start iptables.service
#查看状态
systemctl status iptables.service
删除docker0 详见删除该死的docker0
然后重启docker服务
service docker restart
使用自己编译的Docker 镜像创建容器失败,提示"exec:“bash”:executable file not found in $PATH,换了多种常用命令,均是报这种错误提示
原因:镜像导出与导入的命令未对应上
镜像导出与导入命令需要配对上,否则会报上述错误。
具体配对规则如下:
导出:docker export ContainerID > test.tar
对应导入命令:cat test.tar | docker import - test
导出:docker save ContainerID > test.tar
对应导入命令:docker load < mysql.tar
参考:https://yq.aliyun.com/articles/278801