Automatically Restart Containers

Create Container

Create and run (docker run) a detacted container (--detach) that will automatically restart (--restart) using the nginx:latest Docker image.

docker run --detach --restart always nginx:latest
[sudo] password for chris: 
/ /docker-entrypoint.d/ is not empty, will attempt to perform configuration
/ Looking for shell scripts in /docker-entrypoint.d/
/ Launching /docker-entrypoint.d/ Getting the checksum of /etc/nginx/conf.d/default.conf Enabled listen on IPv6 in /etc/nginx/conf.d/default.conf
/ Launching /docker-entrypoint.d/
/ Configuration complete; ready for start up