简体   繁体   English

将 docker buildx 功能与 Jenkins docker.build 一起使用

[英]Use docker buildx feature with Jenkins docker.build

I want to use experimental docker buildx feature with my Jenkins pipeline docker.build .我想将实验性 docker buildx功能与我的 Jenkins 管道docker.build 一起使用。 AFAIK docker.build allows only build arguments provide. AFAIK docker.build 只允许构建 arguments提供。 But want I need is provide build as argument itself provide to buildx但我需要的是提供build作为参数本身提供给buildx

You can set alias for docker buildx by running this command docker buildx install .您可以通过运行此命令docker buildx installdocker buildx设置别名。

This will use buildx builder whenever you call docker build .每当您调用docker build时,这将使用buildx builder。

Source 资源

However, Jenkins' docker plugin doesn't support it at the time of writing and there is an open issue for that .但是,Jenkins 的 docker 插件在撰写本文时不支持它,并且存在一个未解决的问题

Alternatively, you can build images without plugin:或者,您可以在没有插件的情况下构建图像:

steps {
  script {
    sh """
      docker build buildx ...
    """
  }
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM