I want to set up the configuration for Docker as such that, on boot, it does not automatically start the containers.
I've read about disabling the service with systemctl, which would required enabling it manually on next boot.
That being said, I would prefer it if I could configure the systemd service for Docker to wait for the presence of a certain file, in a certain location.
Once the file appears, it can start. And then I just remove it again. This means not having to set the service to disabled every time and potentially entering the wrong command and shutting it back down.
I've google for this, but can't find it.
Things like Wants=
and Required=
in the Unit file seem to only accept other services and not file locations.
How could this be done?
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 correspondingdocker.service
unit. It might look something like this: