如何通过Docker文件使我的虚拟Docker仓库拉取我的父Microsoft Docker镜像?

huangapple go评论50阅读模式
英文:

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 &lt;my-org&gt;.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:

 =&gt; ERROR [internal] load metadata for &lt;my-org&gt;.com/artifactory/docker-base/dotnet/sdk:6.0                           1.0s
------
 &gt; [internal] load metadata for &lt;my-org&gt;.com/artifactory/docker-base/dotnet/sdk:6.0:
------
failed to solve with frontend dockerfile.v0: failed to create LLB definition: &lt;my-org&gt;.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 .com/artifactory/docker-base/dotnet/aspnet:6.0

更改为

FROM .com/docker-base/dotnet/aspnet:6.0

英文:

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 &lt;Artifactory Host IP Address&gt;/&lt;REPOSITORY_KEY&gt;/&lt;IMAGE&gt;:&lt;TAG&gt;

docker login -u &lt;USER_NAME&gt; -p &lt;USER_PASSWORD&gt; &lt;Artifactory Host IP Address&gt;

In your case, try changing this

FROM &lt;my-org&gt;.com/artifactory/docker-base/dotnet/aspnet:6.0

To,

FROM &lt;my-org&gt;.com/docker-base/dotnet/aspnet:6.0

huangapple
  • 本文由 发表于 2023年6月22日 04:59:34
  • 转载请务必保留本文链接:https://go.coder-hub.com/76527095.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定