1. 运行命令:
docker run -d --hostname my-rabbit -p 5672:5672 -p 15672:15672 rabbitmq:3.7.7-management
  1. 配置防火墙,添加开放端口

CentOS 7.0防火墙设置和关闭

  1. 错误信息
docker: Error response from daemon: driver failed programming external connectivity on endpoint affectionate_chaum (0fa7f13a2f21a7f5bb70a878f6cbcdc5331ebde4dbf76090c48f4fa68c1c2d69):  (iptables failed: iptables --wait -t nat -A DOCKER -p tcp -d 0/0 --dport 15672 -j DNAT --to-destination 172.17.0.2:15672 ! -i docker0: iptables: No chain/target/match by that name.
 (exit status 1)).

解决:
重启docker容器

systemctl restart docker.service
  1. 打开网页
192.168.111.12:15672
guest/guest
  1. 日志打印:
docker logs -f -t --tail 10 docker_id
docker logs -f -t --tail 10 6fc654667ca1
Last modification:February 13th, 2020 at 03:54 pm
如果觉得我的文章对你有用,请随意赞赏