docker-simple-mail-forwarder
docker-simple-mail-forwarder copied to clipboard
Update instructions for starting container on reboot
Related: https://stackoverflow.com/a/57532307/2245107
Thanks for your contribution! But I believe the --restart=always docker run parameter has already made the container start on reboot?
According to my test it only starts after logon.
I don't think do, because I have many servers and I don't remember there's any cases that the container can not get started after the server reboot.
Could you please double confirm it?
Actually it only runs after I run docker ps. Selection of syslog:
May 3 09:22:55 server kernel: [ 0.000000] Linux version 5.3.0-51-generic (buildd@lgw01-amd64-018) (gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04))
#44~18.04.2-Ubuntu SMP Thu Apr 23 14:27:18 UTC 2020 (Ubuntu 5.3.0-51.44~18.04.2-generic 5.3.18)
...
(log in)
May 3 09:27:45 server systemd[1]: Starting User Manager for UID 0...
...
(run docker ps)
May 3 09:30:08 server systemd[1]: Reached target Network is Online.
May 3 09:30:08 server systemd[1]: Starting Docker Application Container Engine...
Using crontab fixes this.
I'll have a test about it when I got time.
Basically I don't think that there's any need to add anything into the crontab.
I believe the answer in the StackOverflow link agree with me that there's no crontab need to be added: https://stackoverflow.com/a/30450350/1123955