Docker远程API登录到注册表

问题描述:

我正在寻找码头登录的文档,我需要登录到注册表来拖动码头图像,我需要使用码头远程API远程执行它。Docker远程API登录到注册表

但不幸的是我无法找到码头远程API文档,任何帮助将不胜感激。

API文档: https://docs.docker.com/engine/reference/api/docker_remote_api_v1.19/

在此先感谢。 萨拉克里希南

你去为

docker login your.domain.to.the.registr.without.protocol.or.port 
enter username 
enter password 

现在你可以使用拉docker pull your.domain.to.the.registr.without.protocol.or.port/youimage

确保您的注册表中的SSL代理/终止背后运行,或者您遇到的安全问题。考虑阅读本例https://docs.docker.com/registry/insecure/

+0

感谢您的答复,我能够从Docker主机做到这一点,我想用Docker Remote API来做到这一点。我正在使用API​​:https://docs.docker.com/engine/reference/api/docker_remote_api_v1.20/#/push-an-image-on-the-registry。在标题上,我设置了X-Registry-Auth及其值 - {'username':'user','password':'paasswd','email':'[email protected]','serveraddress':'server .com'}。当我这样做时,我得到401身份验证失败。但是,当我使用相同的凭据时,我可以使用cli从docker主机登录。 –