deploy

指定与服务运行和部署相关的配置。只有在swarm上使用docker stack deploy时才会生效,在docker-compose up和docker-compose run时会被忽略。

 version: "3.8"
 services:
   redis:
     image: redis:alpine
     deploy:
       replicas: 6
       placement:
         max_replicas_per_node: 1
       update_config:
         parallelism: 2
         delay: 10s
       restart_policy:
         condition: on-failure

有若干子选项可用。

Last updated