安裝:
編寫yml
# vim visualizer.yml
version: "3.7" services: visualizer: image: dockersamples/visualizer:stable ports: - 8080:8080 stop_grace_period: 1m30s volumes: - /var/run/docker.sock:/var/run/docker.sock deploy: placement: constraints: [node.role == manager] resources: limits: cpus: '0.50' memory: 150M reservations: cpus: '0.25' memory: 100M
執行yml腳本
# docker stack deploy -c visualizer.yml visualizer
開啟網頁
http://x.x.x.x:8080