栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 面试经验 > 面试问答

如何以最少的停机时间在docker

面试问答 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

如何以最少的停机时间在docker

如果您使用docker-compose运行yml,则可以运行

docker-compose up-d
它,它将重新创建所有具有更改的容器,并保持所有不变的服务不变。

$ cat docker-compose.env2.ymlversion: '2'services:  test:    image: busybox    # command: env    command: tail -f /dev/null    environment:      - MY_VAR=hello      - MY_VAR2=world  test2:    image: busybox    command: tail -f /dev/null    environment:      - MY_VAR=same ole same ole$ docker-compose -f docker-compose.env2.yml up -d   Creating network "test_default" with the default driverCreating test_test_1Creating test_test2_1$ vi docker-compose.env2.yml # edit the file to change MY_VAR$ docker-compose -f docker-compose.env2.yml up -dRecreating test_test_1test_test2_1 is up-to-date

如果您

docker stack deploy -c docker-compose.yml
使用版本3文件格式运行容器,则可以对服务进行滚动更新,如果您有多个服务实例在运行,它将防止任何停机。此功能仍是非常新的功能,您需要1.13.1修复某些更新问题,并且与任何新功能一样,错误仍在解决中。



转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/369163.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号