In a project with a Dockerfile, This pipeline succeeds:
This pipeline fails:
The reason this happens is that the agent inside a stage step does not do checkout scm automatically. This is very confusing behavior.
Agent initialization should be consistent whether at top or inside a stage.
The following also works, because of reuseNode true, but dockerfile would never work without that when inside a state (due to