简体   繁体   English

限制对Docker Hub的访问

[英]Limiting access to Docker Hub

I'm looking at using Artifactory ( as we already have it in the enterprise ) to store Docker images that we create. 我正在考虑使用Artifactory(因为我们已经在企业中拥有它)来存储我们创建的Docker映像。 I'm hoping to provision and run those images using docker-compose. 我希望使用docker-compose设置和运行这些图像。

If possible, I would like to make it impossible for devs to pull images from DockerHub, but I can't see how to achieve this. 如果可能的话,我想使开发人员不可能从DockerHub中提取图像,但是我看不到如何实现这一点。 If someone puts 如果有人放

   postgres:
      image: "postgres:9.4"

in their compose file then this will pull the postgres image from docker hub. 在他们的撰写文件中,这将从docker hub提取postgres图像。 I'd like to limit the scope of the search that is undertaken so that only images in my local repo are considered. 我想限制搜索的范围,以便只考虑本地回购中的图像。 My rationale is that someone can accredit the images that are in my local repo so we can limit the number of vulnerabilities that we are open to. 我的理由是,某人可以对我本地存储区中的图像进行认证,因此我们可以限制我们可以打开的漏洞数量。

Is this possible? 这可能吗?

Is it a good idea? 这是个好主意吗?

You are in the right direction, proper dependency management is one of the pains Artifactory aims to alleviate - I suggest you start by reading this post about your exact issue that explains how can Artifactory be leveraged to solve this issue. 您朝着正确的方向发展,正确的依赖关系管理是Artifactory旨在缓解的难题之一-我建议您首先阅读有关您的确切问题的这篇文章 ,该文章说明了如何利用Artifactory解决此问题。

For your specific usecase you can either limit developers to only pull from a local repository (or several aggregated into a virtual repository) that holds only 'approved' images (using permission targes to limit access only to that repository).Or you can setup include/exclude patterns on your remote repository that proxies Docker Hub - but I feel this might be a bit of an overkill, and can be error prone unless you have very specific images you want to limit. 对于特定的用例,你可以限制开发商只能从本地存储库拉(或几个聚集成一个虚拟资源库)只保存“批准”的图像(使用许可targes限制只对访问版本库)。或者你可以设置包括/ exclude代理Docker Hub的远程存储库上的模式 -但我觉得这可能有点过大,并且容易出错,除非您要限制的图像非常具体。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM