给指定节点添加label:
docker node update <node_id> --label-add manager=yes
获取所需镜像:
docker pull portainer/portainer-ce:2.0.0-alpine
docker pull portainer/agent:linux-amd64-2.0.0-alpine
获取部署模板并修改:
curl -L https://downloads.portainer.io/portainer-agent-stack.yml -o portainer-agent-stack.yml
部署命令:
docker stack deploy --compose-file=portainer-agent-stack.yml portainer