Jenkins Pipeline docker.build() gives error '"docker build" requires exactly 1 argument(s)' : <p>With this minimal Jenkins Pipeline script</p>

<pre><code>node {
  docker.build("foo", "--build-arg x=y")
}
</code></pre>

<p>I'm getting a confusing error</p>

<blockquote>
  <p>"docker build" requires exactly 1 argument(s).</p>
</blockquote>

<p>But as per the documentation, the signature of <code>docker.build()</code> is <code>build(image[, args])</code> (from Jenkins <code>/job/dockerbug/pipeline-syntax/globals#docker</code>)</p>

<blockquote>
  <p><code>build(image[, args])</code></p>
  
  <p>Runs docker build to create and tag the specified
  image from a Dockerfile in the current directory. Additional args may
  be added, such as <code>'-f Dockerfile.other --pull --build-arg
  http_proxy=http://192.168.1.1:3128 .'</code>. Like docker build, args must
  end with the build context. Returns the resulting Image object.
  Records a FROM fingerprint in the build.</p>
</blockquote>

<p>What's going on?</p>
