运行容器portainer ( 5001映射9000)
docker run -d -p 5001:9000 --restart=always -v /var/run/docker.sock:/var/run/docker.sock --name prtainer-test docker.io/portainer/portainer
执行命令后报错,不管他,重启docker服务就行
systemctl restart docker
报错就像下面这样。。。不管搞啥都遇坑,这就是我。。。。。。
[root@localhost conf.d]# docker run -d -p 5001:9000 --restart=always -v /var/run/docker.sock:/var/run/docker.sock --name prtainer docker.io/portainer/portainer
893490be1ec9cf0a4014835a63b67502eee5be0e6c9aaf38b1d39143b4fd685a
/usr/bin/docker-current: Error response from daemon: driver failed programming external connectivity on endpoint prtainer (a8f5e53f3f6827b33e7cd79bccf9296bd63626e1abc04da0f4163ec2ed5625a6): (iptables failed: iptables --wait -t nat -A DOCKER -p tcp -d 0/0 --dport 5001 -j DNAT --to-destination 172.17.0.2:9000 ! -i docker0: iptables: No chain/target/match by that name.
(exit status 1)).
[root@localhost conf.d]# firewall-cmd --list-all
public (active)
target: default
icmp-block-inversion: no
interfaces: enp1s0
sources:
services: ssh dhcpv6-client
ports: 80/tcp 8080/tcp 5000/tcp 7072/tcp 7073/tcp 6379/tcp 3306/tcp 81/tcp 5001/tcp
protocols:
masquerade: no
forward-ports:
source-ports:
icmp-blocks:
rich rules:
rule family="ipv4" source address="192.168.0.73" port port="2375" protocol="tcp" accept
访问页面http://192.168.0.243:5001
图片.png新建一个容器,然后启动报错垫片错误:未在系统上安装docker-runc,那么执行命令
[root@localhost conf.d]# cd /usr/libexec/docker/
[root@localhost docker]# ln -s docker-runc-current docker-runc
[root@localhost docker]#
然后重新点击开始就ok了
图片.png
这就是刚刚用portainer开启的docker容器
图片.png
网友评论