docker - How to get transferable docker compose stack without dockerhub
问题描述
I have few docker images composed together in the stack using docker-compose.yml.
Now I want to transfer whole docker compose stack to the other host machine without uploading to the dockerhub, And deploy it on the docker swarm.
I saw there is a thing called docker compose bundle, would that help?
解决方案
如果您在多主机集群(或类似 Kubernetes 或 Nomad 的东西)上进行部署,那么您只需要一个 Docker 注册表。它不一定是 Docker Hub——quay.io、亚马逊的 ECR、谷歌的 GCR 和自托管的注册中心都可以正常工作——但你确实需要将构建的镜像推送到协调器可以通过名称检索它们的地方。
我自己从未使用过docker-compose bundle
,但它的文档还指出它的操作“需要与 Docker 注册表交互”。
唯一真正的替代方法是使用docker save
和docker load
在机器之间手动移动图像,但作为手动过程,它很快就会变得乏味,并且您需要确保每台机器上都有一组相同的图像以保持一致性。使用注册表会容易得多。
推荐阅读
- woocommerce - 从 WooCommerce 类别列表中排除特定类别
- javascript - 如何应用升序排序来拆分数据表中的数据
- c++ - 使用 C++ 在 MFC 对话框中显示位图图像
- r - 在 R 中,如何找到位于工作目录之上的任何父目录中的文件?
- spring - 在 Spring Boot 规范中排序
- yaml - 资源 SecretsManager 的资源属性 MySecretA 无效,如何在 yml 中创建多个秘密?
- php - 在上传到 S3 存储桶之前减少 Laravel 中的图像大小(不是尺寸)
- javascript - 如何将表单验证发布到一个警报()?
- java - 如何在 Geronimo Server 中安装证书并传递用户名和密码
- python - Pandas:根据列的差异创建包含组的列