在空白环境中使用Docker的最佳实践 [英] Best practices for using docker in an air-gapped environment

查看:72
本文介绍了在空白环境中使用Docker的最佳实践的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Docker的新手,并且想在有空隙的环境中使用它。我知道我可以在隔离的系统中建立自己的存储库,但是我不知道如何将需要的许多Docker映像从Docker Hub导入到环境中。如果我可以将它们下载到.zip或.tgz归档文件中,那就太好了,但是找不到从该中心执行此操作的方法。我不能在隔离环境之外使用Docker。我可以在空白环境之外使用git,但是获取.zip存档会更好。

I'm new to Docker, and would like to use it in an air-gapped environment. I understand I can set up my own repository inside my isolated system, but I don't know how to get the many docker images I need from the docker hub into the environment. If I could download them to a .zip or .tgz archive, that would be great, but don't see a way to do that from the hub. I can't use Docker outside the isolated environment. I may be able to use git outside my air-gapped environment, but getting .zip archives would be much better. Advice on how to get started will be appreciated.

推荐答案

您可以执行以下操作以为文档中的任何图像生成存档文件。集线器:

You can do the following to produce an archive file for any image on the Hub:

docker pull image:tag
docker save image:tag -o file.tar

然后将 file.tar 转移到有空隙的机器上做:

Then transfer file.tar to the air-gapped machine and just do:

docker load -i file.tar

如果您实际上有一个空缺的网络,而不是一台计算机,那么在包含您策划的图像的网络中设置自己的注册表可能是一个更好的主意。

If you actually have an air-gapped network, rather than a single machine, it's probably a better idea to set up your own registry within the network that contains your curated images.

这篇关于在空白环境中使用Docker的最佳实践的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆