简体   繁体   English

无法在集群上使用 Singularity 登录私有 Docker 注册表

[英]Unable to login to private Docker registry using Singularity on cluster

I've been trying to login to the private Docker registry of the GitLab instance of my university.我一直在尝试登录我大学 GitLab 实例的私有 Docker 注册表。 Since Docker is not installed on the cluster I'm working on I'm using Singularity.由于 Docker 未安装在我正在处理的集群上,因此我使用的是 Singularity。

When trying to login I'm facing an error:尝试登录时遇到错误:

 while login to docker://git.tu-berlin.de:5000: Get "https://git.tu-berlin.de:5000/v2/": Forbidden

Now when I'm using that URL in Firefox I get:现在,当我在 Firefox 中使用该 URL 时,我得到:

在此处输入图片说明

but I'm also never asked for a password so I guess it's obvious that I'm unauthorized.但我也从来没有被要求输入密码,所以我想很明显我是未经授权的。 I'm not sure whether this is related but I have two proxy definitions in my ~.bashrc since the compute nodes don't have access to the internet directly:我不确定这是否相关,但我的~.bashrc有两个代理定义,因为计算节点无法直接访问互联网:

export https_proxy=http://[nodeurl]:port/
export http_proxy=http://[nodeurl]:port/

where nodeurl and port are replaced by the actual values of course.当然,其中nodeurlport被实际值替换。 Could that be the issue?这可能是问题吗? I'm confused since entering the URL https://git.tu-berlin.de:5000/v2/ on my local laptop gives me unauthorized but I can login through Singularity to the private registry and pull images when not logging in before with Docker.我很困惑,因为在我的本地笔记本电脑上输入 URL https://git.tu-berlin.de:5000/v2/未经授权,但我可以通过 Singularity 登录到私有注册表并在之前未登录时提取图像码头工人。

The easiest way to use docker credentials (whether for a private or public registry) is with the environment variables SINGULARITY_DOCKER_USERNAME and SINGULARITY_DOCKER_PASSWORD .使用 docker 凭证(无论是私有注册表还是公共注册表)的最简单方法是使用环境变量SINGULARITY_DOCKER_USERNAMESINGULARITY_DOCKER_PASSWORD If set, singularity attempts to use these for all docker registry interactions, so it is generally useful to only set them when you need.如果设置,Singularity 会尝试将这些用于所有docker 注册表交互,因此仅在需要时设置它们通常很有用。 Additional info is available in the docs: Authentication via Environment Variables文档中提供了其他信息: 通过环境变量进行身份验证

The proxy issue is a bit trickier.代理问题有点棘手。 Singularity doesn't appear to handle those directly, relying instead on the OS to do its thing. Singularity 似乎并不直接处理这些,而是​​依靠操作系统来完成它的工作。 Try using the env variables (or the interactive method also listed in the docs) on your local to ensure it's working, and then give it a try in the cluster.尝试在本地使用 env 变量(或文档中也列出的交互方法)以确保它正常工作,然后在集群中尝试一下。 If it's still not playing nice there, you might have to get a bit creative or contact the admins for guidance.如果它仍然在那里玩得不好,你可能需要有点创意或联系管理员寻求指导。

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

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