I have a very specific issue with running a Docker container on boot using systemd.
The container starts and stops successfully with the following scripts:
start-container.sh
#!/usr/bin/env bash
sleep 5
docker start container_name
stop-container.sh
#!/usr/bin/env bash
sleep 5
docker stop container_name
However, when I configure the following service using systemd, it does not run successfully:
[Unit]
Description=Docker Container
After=network.target
After=systemd-user-sessions.service
After=network-online.target
After=multi-user.target
[Service]
User=root
Type=simple
ExecStart=/home/seed/scripts/start-container.sh
ExecStop=/home/seed/scripts/stop-container.sh
TimeoutSec=60
Restart=on-failure
RestartSec=30
StartLimitInterval=350
StartLimitBurst=10
[Install]
WantedBy=default.target