解決docker和firewall的沖突問(wèn)題
問(wèn)題:防火墻設(shè)置了但是無(wú)法生效,端口不受控制,防火墻報(bào)錯(cuò)
?WARNING: COMMAND_FAILED: '/usr/sbin/iptables -w2 -t filter -C DOCKER ! -...in?)
WARNING: COMMAND_FAILED: '/usr/sbin/iptables -w2 -t nat -C POSTROUTING -...name.
Dec 01 14:30:34 trail firewalld[107809]: WARNING: COMMAND_FAILED: '/usr/sbin/iptables -w2 -t filter -n -L DOCKER-...name.
Dec 01 14:30:34 trail firewalld[107809]: WARNING: COMMAND_FAILED: '/usr/sbin/iptables -w2 -t filter -C DOCKER-USE...in?).
Dec 01 14:30:34 trail firewalld[107809]: WARNING: COMMAND_FAILED: '/usr/sbin/iptables -w2 -t filter -C FORWARD -j...name.
Dec 01 14:30:41 trail firewalld[107809]: WARNING: COMMAND_FAILED: '/usr/sbin/iptables -w2 -t nat -C DOCKER -p tcp...name.
Dec 01 14:30:41 trail firewalld[107809]: WARNING: COMMAND_FAILED: '/usr/sbin/iptables -w2 -t filter -C DOCKER ! -...in?).
Dec 01 14:30:41 trail firewalld[107809]: WARNING: COMMAND_FAILED: '/usr/sbin/iptables -w2 -t nat -C POSTROUTING -...name.
解決:試過(guò)很多辦法,關(guān)閉了firewall,使用iptables,發(fā)現(xiàn)docker容器mysql無(wú)法被外部訪問(wèn),最后還是使用了firewall,重啟多次正常沒(méi)有報(bào)錯(cuò)。
