jenkinsfile docker.withRegistry 使用子域方法推送到artifactory
I've configured our artifactory instance using the 存储库路径方法。我正在尝试将内置的詹金斯(Jenkins)内置的图像推向文物,但它似乎忽略了存储库本身。
def dockerImage = _dockerImage("kl_alpha")
docker.withRegistry( "https://artifactory-dev.foobar.com/docker-local", "someCreds") {
// def dockerImage = docker.build("kl_alpha:$BUILD_NUMBER", "./")
dockerImage.push()
dockerImage.push("latest")
}
詹金斯(Jenkins)中的输出看起来像这样
+ docker push artifactory-dev.foobar.com/kl_alpha:25
The push refers to repository [artifactory-dev.foobar.com/kl_alpha]
,它忽略了地址的码头 - 位置部分。有什么想法吗?
I've configured our artifactory instance using the repository path method. I'm trying to push an image built in Jenkins to Artifactory, but it seems to ignore the repository path itself.
def dockerImage = _dockerImage("kl_alpha")
docker.withRegistry( "https://artifactory-dev.foobar.com/docker-local", "someCreds") {
// def dockerImage = docker.build("kl_alpha:$BUILD_NUMBER", "./")
dockerImage.push()
dockerImage.push("latest")
}
The output in Jenkins looks something like this
+ docker push artifactory-dev.foobar.com/kl_alpha:25
The push refers to repository [artifactory-dev.foobar.com/kl_alpha]
As you can see, it's ignoring the docker-local part of the address. Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对于 Docker 和 Jenkins Pipeline 的 Docker 插件,存储库是镜像参数的一部分,而不是注册表的一部分。一般来说,这看起来像:
请注意,Jenkins Pipeline 的 Artifactory Docker 注册表文档有时会使用术语“存储库”,而实际上它的意思是“注册表”,这可能会造成混淆和误导。另请注意,某些图像没有参数的存储库部分,因为它们是官方的。
在您的情况下,代码将如下所示:
For Docker and the Docker plugin for Jenkins Pipeline, the repository is part of the image argument, and not the registry. In general this would appear like:
Note that Artifactory Docker registry documentation for Jenkins Pipeline sometimes uses the term "repository" when it actually means "registry", and that can be confusing and misleading. Note also that some images do not have a repository part of the argument because they are official.
In your situation, the code would appear like: