Automatically start docker on reboot of linux machine


I’m trying to look out for a way to start the docker container after the linux(centos7) machine is rebooted.
I followed the document where we can use --restart=always flag, but only using this doesn’t work.

On looking around, I saw people using systemd service to keep the docker running.
I am facing issues there also, and want to know if this is the right way?

Thanks :v:t3:

Systemd is for running the docker daemon. If you installed Docker from the official documentation

the daemon should start automatically and that starts the containers.