Docker和Dockerhub力量以获取最新图像,但保留卷
我有一个脚本可以启动从Dockerhub撤出的Docker图像,
我在相应标签(服务器和工作人员)
链接。
下按照docker compose
update.sh脚本将删除当前图像但保留卷并从dockerhub获取最新图像?
我总是敦促
scanmycode/scanmycode3-ce:server
scanmycode/scanmycode3-ce:worker
这是错误的方式吗?如何实现?
欢迎改善工作流/设置的任何技巧。
I have a script to start Docker images pulled from DockerHub
I push the images under respective tags (server and worker)
Here is link to docker compose
https://github.com/marcinguy/scanmycode-ce/blob/master/dockerhub/docker-compose.yml
How do I make update.sh script that will delete current images but preserve volumes and get latest one from DockerHub?
I always push to
scanmycode/scanmycode3-ce:server
scanmycode/scanmycode3-ce:worker
Is it wrong way to so it? How to achieve it?
Any tips for improving my workflow/setup is welcome.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Docker卷具有您可以使用的其他参数,使Docker-Compose忽略了卷的创建/删除。基于官方文档> - 在卷下 - 看音量配置参考 - 外部。
因此,您可以手动创建Docker卷 create 命令和命令和命令和命令和然后调整您的Docker-Compose.yml以参考这些量。在这种情况下,每当您呼叫上/向下拨打时,它都不会创建/调整/删除量。
Docker volumes have additional parameters you can use which makes docker-compose ignore the volume creation/deletion. Based on official documentation - Look under Volumes - Volume configuration reference - external.
So you can then manually create the volumes needed with docker volume create command and then adjust your docker-compose.yml to reference to these volumes. In that case, whenever u call compose up/down it won't create/adjust/remove your volumes.