With this minimal Jenkins Pipeline script
node {
docker.build(\"foo\", \"--build-arg x=y\")
}
I\'m getting a confusing error
My confusion was because the error message is actually coming from Docker, not Jenkins.
Docker gives this error if you don't specify a build context (as noted in the docs above).
The fix is just to add .
to the end of the args parameter as per the example, eg:
node {
docker.build("foo", "--build-arg x=y .")
}
See docker: "build" requires 1 argument. See 'docker build --help'