Use docker buildx feature with Jenkins docker.build

Viewed 2082

I want to use experimental docker buildx feature with my Jenkins pipeline docker.build. AFAIK docker.build allows only build arguments provide. But want I need is provide build as argument itself provide to buildx

1 Answers

You can set alias for docker buildx by running this command docker buildx install.

This will use buildx builder whenever you call docker build.

Source

However, Jenkins' docker plugin doesn't support it at the time of writing and there is an open issue for that.

Alternatively, you can build images without plugin:

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