英文:
How do I get my virtual docker repo to pull my parent microsoft docker image via docker file?
问题
在我的Artifactory中,我创建了一个名为"docker-base"的虚拟Docker仓库。
然后我创建了一个名为"docker-microsoft"的远程Docker仓库。
远程仓库的URL设置为"https://mcr.microsoft.com"。
现在,我将我的远程仓库添加到虚拟基础仓库中。
现在,在我的Artifactory虚拟Docker仓库中,文件的URL显示为:
my-org.com/artifactory/docker-base/
在我的Dockerfile中,我有以下内容:
FROM mcr.microsoft.com/dotnet/aspnet:6.0
我将其更改为:
FROM <my-org>.com/artifactory/docker-base/dotnet/aspnet:6.0
在我的计算机上,我执行了docker登录到我的Artifactory仓库,并且登录成功。
当我执行docker-compose build时,我收到以下错误信息:
=> ERROR [internal] load metadata for <my-org>.com/artifactory/docker-base/dotnet/sdk:6.0 1.0s
------
> [internal] load metadata for <my-org>.com/artifactory/docker-base/dotnet/sdk:6.0:
------
failed to solve with frontend dockerfile.v0: failed to create LLB definition: <my-org>.com/artifactory/docker-base/dotnet/sdk:6.0: not found
所以我不认为我的设置是正确的,我不确定我在哪里搞错了。
英文:
So in my artifactory I created a virtual docker repo named "docker-base"
I then created a remote docker repo named "docker-microsoft"
The remote repository url is set to "https://mcr.microsoft.com"
I now add my remote repo in the virtual base repo.
Now in my virtual docker repo in artifactory, the url to file shows:
my-org.com/artifactory/docker-base/
In my dockerfile I had:
FROM mcr.microsoft.com/dotnet/aspnet:6.0
I changed this to:
FROM <my-org>.com/artifactory/docker-base/dotnet/aspnet:6.0
on my machine I do a docker login to my artifactory repo and it is successful.
when I do docker-compose build I get the following error:
=> ERROR [internal] load metadata for <my-org>.com/artifactory/docker-base/dotnet/sdk:6.0 1.0s
------
> [internal] load metadata for <my-org>.com/artifactory/docker-base/dotnet/sdk:6.0:
------
failed to solve with frontend dockerfile.v0: failed to create LLB definition: <my-org>.com/artifactory/docker-base/dotnet/sdk:6.0: not found
So I do not think my setup is correct, I am just not sure where I am messing up.
答案1
得分: 2
我看到您正在使用存储库路径方法。
相同方法的docker pull或push和登录命令示例是:
docker pull/push <Artifactory主机IP地址>/<REPOSITORY_KEY>/
docker login -u <USER_NAME> -p <USER_PASSWORD> <Artifactory主机IP地址>;
在您的情况下,请尝试将这个
FROM
更改为
FROM
英文:
I see that you are using Repository Path Method.
The example of docker push or pull and login commands for the same methods are:
docker pull/push <Artifactory Host IP Address>/<REPOSITORY_KEY>/<IMAGE>:<TAG>
docker login -u <USER_NAME> -p <USER_PASSWORD> <Artifactory Host IP Address>
In your case, try changing this
FROM <my-org>.com/artifactory/docker-base/dotnet/aspnet:6.0
To,
FROM <my-org>.com/docker-base/dotnet/aspnet:6.0
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论