docker技巧

docker 管理界面 portainer 的启动 (管理swarm mode 集群)

portainer:
https://portainer.readthedocs.io/en/latest/deployment.html
只在miji0qamdnvkrinj009qa77yy  上运行portainer:

   docker service create \
    –name portainer \
    –publish 9000:9000 \
    –constraint ‘node.id == miji0qamdnvkrinj009qa77yy’ \
    –mount type=bind,src=//var/run/docker.sock,dst=/var/run/docker.sock \
    –mount type=bind,src=/data/portainer/data,dst=/data \
    docker.ifeng.com/portainer/portainer \
    -H unix:///var/run/docker.sock

其他约束用法:
    –constraint ‘node.id == asdfasdfadf’ 
    –constraint ‘node.role != manager’
    –constraint ‘node.hostname == node-1’
    –constraint ‘node.labels.type == database’
————————————————–