1、安裝Docker之後,下載不了鏡像,錯誤爲
[root@localhost ~]# docker run hello-world Unable to find p_w_picpath 'hello-world:latest' locally Pulling repository docker.io/library/hello-world docker: Get https://registry-1.docker.io/v1/repositories/library/hello-world/tags/latest: dial tcp: lookup registry-1.docker.io on 172.16.1.2:53: no such host. See 'docker run --help'.
解決辦法,找個合適的***工具.
2、CentOS7防火牆問題,不能使用service控制iptables。 需要安裝iptables.services。
3、Docker運行的容器,不能訪問外網。需要在主機上設置NAT規則。
iptables -t nat -A POSTROUTING -s 172.17.0.0/16 -j SNAT --to 172.16.1.70 iptables -A FORWARD -s 172.17.0.0/16 -j ACCEPT iptables -A FORWARD -d 172.17.0.0/16 -j ACCEPT