欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

docker学习的问题3--Error response from daemon: This node is not a swarm manager.

程序员文章站 2024-03-12 10:31:02
...

问题:

[[email protected] ~]# docker network create -d overlay --subnet 172.16.1.0/24 --gateway 172.16.1.254 ol1
Error response from daemon: This node is not a swarm manager. Use "docker swarm init" or "docker swarm join" to connect this node to swarm and try again.

解决办法:

[[email protected] ~]# vim /usr/lib/systemd/system/docker.service
ExecStart=/usr/bin/dockerd --containerd=/run/containerd/containerd.sock    #修改这一行内容
[[email protected] ~]# systemctl daemon-reload
[[email protected] ~]# systemctl restart docker

验证:

[[email protected] ~]# docker network create -d overlay --subnet 172.16.0.0/24 --gateway 172.16.0.254 ol1
52087a37d9a0c9d977618212a929bf8aea5fbc7c2cbb0b6f02b90e7d2621af3b
相关标签: docker docker