gpt4 book ai didi

docker - 如何从Cloud Foundry上的存储库部署Docker镜像?

转载 作者:行者123 更新时间:2023-12-02 18:52:57 32 4
gpt4 key购买 nike

我推 jetty 图片

cf push --docker-image rocker/rstudio --docker-username rstudio-test

以及分期过程何时开始

我发现401错误
Failed getting docker image by tag: Get https://registry-1.docker.io/v2/rocker/rstudio/manifests/latest: token auth attempt for registry: https://auth.docker.io/token?account=myuser&scope=repository%3Arocker%2Frstudio%3Apull&service=registry.docker.io request failed with status: 401 Unauthorized  Going to retry attempt: 1
Failed getting docker image by tag: Get https://registry-1.docker.io/v2/rocker/rstudio/manifests/latest: token auth attempt for registry: https://auth.docker.io/token?account=myuser&scope=repository%3Arocker%2Frstudio%3Apull&service=registry.docker.io request failed with status: 401 Unauthorized Going to retry attempt: 2
Failed getting docker image by tag: Get https://registry-1.docker.io/v2/rocker/rstudio/manifests/latest: token auth attempt for registry: https://auth.docker.io/token?account=myuser&scope=repository%3Arocker%2Frstudio%3Apull&service=registry.docker.io request failed with status: 401 Unauthorized Going to retry attempt: 3
Failed getting docker image by tag: Get https://registry-1.docker.io/v2/rocker/rstudio/manifests/latest: token auth attempt for registry: https://auth.docker.io/token?account=myuser&scope=repository%3Arocker%2Frstudio%3Apull&service=registry.docker.io request failed with status: 401 Unauthorized
Staging process failed: Exit trace for group:
builder exited with error: failed to fetch metadata from [rocker/rstudio] with tag [latest] and insecure registries [] due to Get https://registry-1.docker.io/v2/rocker/rstudio/manifests/latest: token auth attempt for registry: https://auth.docker.io/token?account=myuser&scope=repository%3Arocker%2Frstudio%3Apull&service=registry.docker.io request failed with status: 401 Unauthorized
Exit status 2

我做了 list 并放入环境选项
env: 
CF_DOCKER_PASSWORD:test

我尝试搜索信息
但我仍然不知道答案

最佳答案

这个...

env: 
CF_DOCKER_PASSWORD:test

不是你想要的。这告诉cf cli设置应用程序可访问的环境变量。只有在您的应用程序启动后才能访问。我们需要先下载容器,然后才能运行它,因此在此处进行设置为时已晚。

您想在计算机上本地设置环境变量,以便在cf cli运行时知道要使用的密码。

因此,您想要...

Mac / Linux:
export CF_DOCKER_PASSWORD=test

视窗:
set CF_DOCKER_PASSWORD=test

然后,您可以运行 cf push --docker-image rocker/rstudio --docker-username rstudio-test。 cf cli将从您的本地环境变量读取密码并将其传递给平台,以便平台可以下载您的docker镜像。

作为FYI,Mac和Linux用户也可以执行 CF_DOCKER_PASSWORD=test cf push ...的缩写。我不相信这可以在Windows上运行。

在这里查看更多详细信息:

https://docs.cloudfoundry.org/devguide/deploy-apps/push-docker.html#private-repo

关于docker - 如何从Cloud Foundry上的存储库部署Docker镜像?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52777747/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com