Don't start systemctl service, like Docker, unless a control file is present

You can add a path unit to monitor a filesystem path and start the corresponding service. You can create a docker.path unit to activate a corresponding docker.service unit. It might look something like this:

[Unit]
Description=Start Docker when my file exists

[Path]
PathExists=/my/path

[Install]
WantedBy=multi-user.target