I have a PiHole running in a VM in the same server as this (serving as my DNS), and I want Docker to start after that VM is started, and when it can find a specific file /mnt/drive/.mounted
.
I read in this reddit post that it’s possible with systemd service https://www.reddit.com/r/docker/comments/ke3twe/how_to_delay_the_start_of_a_container_at_system/
For Snaps, is that a possibility? I was gonna try to edit /etc/systemd/system/snap.docker.dockerd.service
with an override, but I saw that the service file is autogenerated with a specific version of Docker on the After=
field.
### /etc/systemd/system/snap.docker.dockerd.service
# [Unit]
# # Auto-generated, DO NOT EDIT
# Description=Service for snap application docker.dockerd
# Requires=snap-docker-3091.mount
# Wants=network.target
# After=snap-docker-3091.mount network.target snapd.apparmor.service
# X-Snappy=yes
#
# [Service]
# EnvironmentFile=-/etc/environment
# ExecStart=/usr/bin/snap run docker.dockerd
# SyslogIdentifier=docker.dockerd
# Restart=on-failure
# WorkingDirectory=/var/snap/docker/3091
# TimeoutStopSec=30
# Type=simple
# Delegate=true
#
# [Install]
# WantedBy=multi-user.target
Any advice would be greatly appreciated.