`docker pull` 从私有 gitlab 注册表返回 `denied: access forbidden` [英] `docker pull` returns `denied: access forbidden` from private gitlab registry

查看:21
本文介绍了`docker pull` 从私有 gitlab 注册表返回 `denied: access forbidden`的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 Dockerfile,它将在 FROM 私有注册表的映像中实现.我用 Docker version 1.12.6, build 78d1802docker-compose version 1.8.0, build unknown 构建这个文件没有任何问题,但是在另一台有 Docker version 17.06.1-ce, build 874a737docker-compose version 1.16.1, build 6d1ac21docker-compose build 返回:>

I have a Dockerfile which is going to be implemented FROM a private registry's image. I build this file without any problem with Docker version 1.12.6, build 78d1802 and docker-compose version 1.8.0, build unknown, but in another machine which has Docker version 17.06.1-ce, build 874a737 and docker-compose version 1.16.1, build 6d1ac21, the docker-compose build returns:

FROM my.private.gitlab.registry:port/image:tag
http://my.private.gitlab.registry:port/v2/docker/image/manifests/tag: denied: access forbidden

docker pull my.private.gitlab.registry:port/image:tag 返回相同.

注意我试图获取 my.private.registry:port/image:taghttp://my.private.registry:port/v2/docker/image/manifests/tag 已被捕获.

Notice that I tried to get my.private.registry:port/image:tag and http://my.private.registry:port/v2/docker/image/manifests/tag has been catched.

推荐答案

如果这是一个经过身份验证的注册表,那么你需要在你正在构建它的机器上运行 docker login .

If this is an authenticated registry, then you need to run docker login <registryurl> on the machine where you are building this.

这只需为每个主机执行一次.然后该命令将身份验证缓存在一个文件中

This only needs to be done once per host. The command then caches the auth in a file

$ cat ~/.docker/config.json
{
    "auths": {
        "https://index.docker.io/v1/": {
            "auth": "......="
        }
    }
}

这篇关于`docker pull` 从私有 gitlab 注册表返回 `denied: access forbidden`的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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