레퍼런스 {
https://askubuntu.com/questions/620930/how-do-i-autostart-docker-container-at-system-reboot
https://serverfault.com/questions/633067/how-do-i-auto-start-docker-containers-at-system-boot
https://stackoverflow.com/questions/38876993/how-to-auto-start-docker-containers-in-docker-for-mac
https://docs.docker.com/engine/reference/commandline/run/
https://subicura.com/2017/01/19/docker-guide-for-beginners-2.html
http://pyrasis.com/book/DockerForTheReallyImpatient/Chapter20/28
}
docker run 할때 --restart 옵션을 붙인다.
ex > docker run -d --name test_container --restart always test_img
다른 옵션은 아래와 같다.
Restart policies (–restart)
Use Docker’s --restart
to specify a container’s restart policy. A restart policy controls whether the Docker daemon restarts a container after exit. Docker supports the following restart policies:
Policy | Result |
---|---|
no | Do not automatically restart the container when it exits. This is the default. |
failure | Restart only if the container exits with a non-zero exit status. Optionally, limit the number of restart retries the Docker daemon attempts. |
always | Always restart the container regardless of the exit status. When you specify always, the Docker daemon will try to restart the container indefinitely. The container will also always start on daemon startup, regardless of the current state of the container. |
'Tech' 카테고리의 다른 글
PAAS SAAS IAAS (0) | 2017.08.22 |
---|---|
apache derby (0) | 2017.08.16 |
Redis 설치 (0) | 2017.05.26 |
FlashBuilder 에 SVN 플러그인 설치하기 (0) | 2017.04.21 |
이클립스 svn target 제외 ignored 키워드 (0) | 2017.04.14 |