在循环中使用多个伪造图像进行一次扫描

发布于 2025-02-09 13:53:06 字数 803 浏览 1 评论 0原文

我有一个文本文件包含来自文物的图像。 我有一个Shell脚本可以在循环中在这些图像上运行Blackduck扫描,但是我会遇到诸如无效的参考格式之类的错误。

#!/usr/bin/sh
input="dockerimagesURL.txt"
while read dockerimagesURL
do
docker pull "$dockerimagesURL"
DockerImageID=$(docker images "$dockerimagesURL" --format '{{.ID}}')
sudo -S java -jar /home/dxc/Desktop/synopsis-detect-7.11.0/synopsys-detect-7.11.0.jar -- scan command continued.
done < $1

dockerimagesurl.txt文件包含:

buildimages-docker-local.artifactory.com/docker-registry1:tag
buildimages-docker-local.artifactory.com/docker-registry2:tag
buildimages-docker-local.artifactory.com/docker-registry3:tag
buildimages-docker-local.artifactory.com/docker-registry4:tag

上面的脚本由于多种原因而失败: 无效的参考格式

docker pult-不发生

I have a text file contains of images from Artifactory.
I have a shell script to run blackduck scan on those images in a loop but I am getting errors like invalid reference format.

#!/usr/bin/sh
input="dockerimagesURL.txt"
while read dockerimagesURL
do
docker pull "$dockerimagesURL"
DockerImageID=$(docker images "$dockerimagesURL" --format '{{.ID}}')
sudo -S java -jar /home/dxc/Desktop/synopsis-detect-7.11.0/synopsys-detect-7.11.0.jar -- scan command continued.
done < $1

dockerimagesURL.txt file contains:

buildimages-docker-local.artifactory.com/docker-registry1:tag
buildimages-docker-local.artifactory.com/docker-registry2:tag
buildimages-docker-local.artifactory.com/docker-registry3:tag
buildimages-docker-local.artifactory.com/docker-registry4:tag

The above script is failing for multiple reasons:
Invalid reference format

docker pull -- not happening

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

初见 2025-02-16 13:53:06

假设您的完整错误消息是

'docker-registry1:tag'不是有效的存储库/标签:无效的参考格式

“ TAG”是占位符。用真正存在的标签替换它,例如“最新”(默认值)。

buildimages-docker-local.artifactory.com/docker-registry1:latest

如果存储库无效/无法找到该更改之后,此错误仍然可能存在!

Assuming your full error message is

'docker-registry1:tag' is not a valid repository/tag: invalid reference format

'tag' is a placeholder. Replace it by a tag that really exists, e.g. 'latest' (the default).

buildimages-docker-local.artifactory.com/docker-registry1:latest

The error could still exist after that change if the repository is not valid/cannot be found!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文