如何解决没有可用的图像版本
Concourse 无法从工件中提取 docker 镜像。
我收到错误 no versions of image available
。
我看过类似的帖子,但它们没有帮助解决我遇到的问题。
我的 Dockerfile
FROM adoptopenjdk:8u275-b01-jre-hotspot
USER root
COPY ./Certs/*.cer $JAVA_HOME/lib/security
RUN apt-get update -y && \
apt-get install -y iptables curl
RUN cd $JAVA_HOME/lib/security \
keytool -keystore cacerts -storepass changeit -noprompt -trustcacerts -importcert -alias rootcer -file TrustedRoot.cer \
keytool -keystore cacerts -storepass changeit -noprompt -trustcacerts -importcert -alias intermediatecert -file TrustedIntermediate.cer
我构建了映像并且构建运行良好。
我还可以通过 docker pull
命令在本地拉取图像
sudo docker images
还展示了我构建的图像。
现在,我将图像推送到了 artifactory:
登录
docker login <artifactory-repo-url>
标签图片
docker tag <IMAGE_ID> <artifactory-repo-url>/<DOCKER_REPOSITORY>:<DOCKER_TAG>
推送图片
docker push <artifactory-repo-url>/<DOCKER_REPOSITORY>:<DOCKER_TAG>
这一切都很好。
我将人工凭证存储在 credhub 中,并授予凭证读取权限。
credhub set -n "concourse/my-team/ARTIFACTORY_SECRET" --type user --username "my-username" --password "MY-API-KEY"
credhub set-permission -p "concourse/my-team/ARTIFACTORY_SECRET" -a "uaa-client:conc_credhub" -o "read"
这是我的 YAML 文件
platform: linux
image_resource:
type: docker-image
source:
repository: <artifactory-repo-url>/<repo-name>
tag: 1.0
username: ((ARTIFACTORY_SECRET.username))
password: ((ARTIFACTORY_SECRET.password))
我得到的错误是 no versions of image available
。
有人可以帮我解决这个问题吗?
谢谢。
==========更新============
我尝试在不使用 credhub 的本地 Concourse 实例上运行它。
我正在使用 credentials.yml
文件,我在其中提供了密钥和用户名,但出现相同的错误。
我可以在运行 Concourse 的同一台机器上使用相同的凭据提取映像。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。