0
点赞
收藏
分享

微信扫一扫

Docker Swarm 常用命令

嚯霍嚯 2022-02-11 阅读 37


在Docker Swarm中经常使用的主要有docker swarm、docker node、docker service、docker stack

1,docker swarm 管理swarm,添加节点

Commands:
init Initialize a swarm
join Join a swarm as a node and/or manager
join-token Manage join tokens
leave Leave the swarm
unlock Unlock swarm
unlock-key Manage the unlock key
update Update the swarm

2,docker node 用于管理节点

Commands:
demote Demote one or more nodes from manager in the swarm
inspect Display detailed information on one or more nodes
ls List nodes in the swarm
promote Promote one or more nodes to manager in the swarm
ps List tasks running on one or more nodes, defaults to current node
rm Remove one or more nodes from the swarm
update Update a node

3,docker service 管理service

Commands:
create Create a new service
inspect Display detailed information on one or more services
logs Fetch the logs of a service or task
ls List services
ps List the tasks of one or more services
rm Remove one or more services
scale Scale one or multiple replicated services
update Update a service

4,docker stack与docker-compose结合的命令,可以方便地在集群中部署应用

Commands:
deploy Deploy a new stack or update an existing stack
ls List stacks
ps List the tasks in the stack
rm Remove one or more stacks
services List the services in the stack




举报

相关推荐

0 条评论