I can only suggest adding a first Command Line step, check if a file exists in a working directory after checkout, and set a parameter in this case, using service messages. After that, you can check the parameter value in a Docker build step.
Direct VCS root browsing isn’t supported by conditional steps at the moment.
BTW, here is the related Feature request in YouTrack – https://youtrack.jetbrains.com/issue/TW-5935.