Dockerfile is not a valid repository/tag: invalid reference format
Docker builds are run on the server, and multi stage builds were introduced in 17.06. You'll need to run the build on a newer server version to support that syntax.
I got the same issue when using GKE. My solution is:
- Add new node pool uses Ubuntu image.
- Then upgrade Docker on these nodes.
- And only spawn new Jenkins slaves on this node pool (using taint & tolerations).
Result: Now I can use multi-stage build for Jenkins slaves running on GKE.