首页 > 解决方案 > 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?

标签: dockerdocker-composedockerfiledocker-swarm

解决方案


如果您在多主机集群(或类似 Kubernetes 或 Nomad 的东西)上进行部署,那么您只需要一个 Docker 注册表。它不一定是 Docker Hub——quay.io、亚马逊的 ECR、谷歌的 GCR 和自托管的注册中心都可以正常工作——但你确实需要将构建的镜像推送到协调器可以通过名称检索它们的地方。

我自己从未使用过docker-compose bundle,但它的文档还指出它的操作“需要与 Docker 注册表交互”。

唯一真正的替代方法是使用docker savedocker load在机器之间手动移动图像,但作为手动过程,它很快就会变得乏味,并且您需要确保每台机器上都有一组相同的图像以保持一致性。使用注册表会容易得多。


推荐阅读