Start Docker container after linux boot Rumi, February 7, 2024 Docker provides restart policies to control whether your containers start automatically when they exit, or when Docker restarts. Restart policies start linked containers in the correct order. Docker recommends that you use restart policies, and avoid using process managers to start containers. Restart policies are different from the –live-restore flag of the dockerd command. Using –live-restore lets you to keep your containers running during a Docker upgrade, though networking and user input are interrupted. The following command starts a Redis container and configures it to always restart, unless the container is explicitly stopped, or the daemon restarts. $ docker run -d --restart unless-stopped redis The following command changes the restart policy for an already running container named redis. $ docker update --restart unless-stopped redis The following command ensures all running containers restart. $ docker update --restart unless-stopped $(docker ps -q) Restart policy details Keep the following in mind when using restart policies: A restart policy only takes effect after a container starts successfully. In this case, starting successfully means that the container is up for at least 10 seconds and Docker has started monitoring it. This prevents a container which doesn’t start at all from going into a restart loop. If you manually stop a container, the restart policy is ignored until the Docker daemon restarts or the container is manually restarted. This prevents a restart loop. Restart policies only apply to containers. To configure restart policies for Swarm services, see flags related to service restart. For details you can read more from docker official doc site- https://docs.docker.com/config/containers/start-containers-automatically/ Related Administrations Docker
NFS fix on LXC Host Server March 17, 2016July 28, 2018 NFS client on LXC seems do not work. Why? The problem is apparmor on the real machine that block any appempt to mount NFS volumes. In order to try to minimize the security changes on apparmor I add the following lines in/etc/apparmor.d/lxc/lxc-default # allow nfs mount everywhere mount fstype=rpc_pipefs, mount… Read More
Install PHPIPAM using Docker on CentOS 7 January 7, 2024 Update Docker Package Database. In a terminal window, type: sudo yum check-update Remove if any docker is preinstalled with your OS- sudo yum remove docker docker-client docker-client-latest docker-common docker-latest docker-latest-logrotate docker-logrotate docker-selinux docker-engine-selinux docker-engine Install the Dependencies sudo yum install -y yum-utils device-mapper-persistent-data lvm2 The –y switch indicates to the yum… Read More
Install cPanel on CentOS 7 February 1, 2020February 1, 2020 cPanel is an online Linux-based web hosting control panel that provides a graphical interface and automation tools designed to simplify the process of hosting a web site or email. Prerequisite: Launch a CentOS 7 instance (Only install cPanel & WHM on a freshly-installed operating system). Access the instance via SSH. Run all the… Read More