restart docker code example

Example 1: how to restart docker linux

$ sudo systemctl start docker

Example 2: docker restart

sudo systemctl restart docker

Example 3: docker run restart on boot

$ docker run -d --restart unless-stopped <image>

Example 4: docker restart container

docker restart CONTAINER_ID

Example 5: docker --restart example

# To limit retart attempt, add [:int]
docker run -d --restart=on-failure:3

Example 6: docker image is not reseting

docker rm -f $(docker ps -a -q)

Tags:

Css Example