【发布时间】:2018-03-16 14:10:23
【问题描述】:
我的本地机器上有一个 docker 映像。当我尝试使用下面的 Jenkins 文件运行映像时。
agent {
docker {
image 'gcc/sample:latest'
args "-v /etc/passwd:/etc/passwd:ro
}
}
然后我收到以下错误。
+ docker pull gcc/sample:latest
Pulling repository docker.io/gcc/sample
Error: image gcc/sample:latest not found
script returned exit code 1
我有什么办法可以在 Jenkins 文件中说在我的本地机器上查找 docker 映像而不是 docker.io 来查找 docker 映像。
【问题讨论】:
-
jenkins 是在 docker 容器中运行,还是直接在机器上运行?
-
Jenkins 直接在 Linux 机器上运行。
-
图片
gcc/sample:latest在本地找到了吗?使用标签 latest 运行docker image ls时会出现吗? -
该图像在本地存在,但是当我使用上面的 Jenkins 文件(图像'gcc/sample:latest')时,它并没有在本地查找。它只在 repo 中查找。
标签: docker jenkins-plugins dockerfile jenkins-pipeline docker-machine