1. The problem is as follows
[root@echohye app]# docker run -itd --name mysql-test -p 3306:3306 -e MYSQL_ROOT_PASSWORD=123456 mysql:5.7
5ae9dc1c7bf16762e7064a5f3ab0396b1f5ba3a23e64997939730f27aa11eebb
docker: Error response from daemon: driver failed programming external connectivity on endpoint mysql-test (b428e451446b6b6bd1be1ea58ca6f66b632680b0756d6fe9c9411099c03dff5b): (iptables failed: iptables --wait -t nat -A DOCKER -p tcp -d 0/0 --dport 3306 -j DNAT --to-destination 172.17.0.2:3306 ! -i docker0: iptables: No chain/target/match by that name.
2. Solution
After consulting the information, it is known that it is the cause of the docker0 bridge. To solve the above error problem, the following steps are required.
1. Kill all docker processes
pkill docker
2. Clear all chains of the nat table
iptables -t nat -F
3. Stop docker default bridge docker0
ifconfig docker0 down
4. Delete the docker0 bridge
brctl delbr docker0
5. Restart the docker service
systemctl restart docker
6. Rerun the original command
[root@echohye /]# docker run -itd --name mysql-test -p 3306:3306 -e MYSQL_ROOT_PASSWORD=123456 mysql:5.7
7097016ef0b1c57b6db110dff96b179f8989427c55b1501c36c1c1fb425ba5ce
[root@echohye /]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
7097016ef0b1 mysql:5.7 "docker-entrypoint.s…" 4 minutes ago Up 4 minutes 0.0.0.0:3306->3306/tcp, :::3306->3306/tcp, 33060/tcp mysql-test
Read More:
- [Solved] Docker: Error response from daemon: driver failed programming external connectivity on endpoint mysq
- [Solved] Docker Error: Error response from daemon: driver failed programming external connectivity on endpoint
- Error response from daemon: driver failed programming external connectivity on endpoint quirky_allen is reported when docker port mapping or starting the container
- [Solved] Docker Error: driver failed programming external connectivity on endpoint
- Docker Create or Start Nginx Error: docker: Error response from daemon: driver failed programming external connectivity
- [Solved] Docker Start nginx error: driver failed programming external connectivity on endpoint nginx
- [Solved] docker Error response from daemon OCI runtime create failed container_linux.go380
- [Solved] Docker failed to start daemon: error initializing graphdriver: driver not supported
- [environment] docker: error response from daemon: OCI runtime
- Docker Error response from daemon: Get https://registry-1.docker.io/v2/portainer/portainer/…
- [Solved] ERROR: for jms_koko Cannot start service koko: driver failed programming
- Docker Error response from daemon: Get https://registry-1.docker.io/v2/: x509: certificate has expired or is not yet valid
- Mac Docker pull Error: Error response from daemon: Get https://xx.xx.xx.xx/v2/: Service Unavailable
- Docker Open Error: Warning: docker.service changed on disk. Run ‘systemctl daemon-reload‘ to reload unit
- [Solved] Error response from daemon: OCI runtime create failed: container with id exists: xxzxxxxxxxx
- [Solved] Error response from daemon: Get “*“: x509: certificate signed by unknown authority
- [Solved] Docker Error: got permission denied while trying to connect to the docker daemon socket at…
- How to Fix ERROR Couldn’t connect to Docker daemon at http+docker://localunixsocket
- [Solved] docker Error: bridge docker0 failed: exchange full
- [Solved] CentOS build a docker error: job for docker.service failed….