프로그램 사용/docker2019. 3. 21. 11:57

docker 의 container도 자동실행이 가능하네?


$ docker run -dit --restart unless-stopped redis 


[링크 : https://docs.docker.com/config/containers/start-containers-automatically/]



restart

no is the default restart policy, and it doesn’t restart a container under any circumstance. When always is specified, the container always restarts. The on-failure policy restarts a container if the exit code indicates an on-failure error.

  - restart: no
  - restart: always 

  - restart: on-failure 

[링크 : https://docs.docker.com/compose/compose-file/compose-file-v2/]



version: '2'

services:

  web:

    image: nginx

    restart: always 


[링크 : https://forums.docker.com/t/how-to-handle-server-reboot-when-using-docker-compose/26374/4]

[링크 : https://askubuntu.com/questions/612928/how-to-run-docker-compose-at-bootup]


+

2019.04.26

해보니 되긴하네.vim에서 restart: 뒤에 공백이 없으면 문법강조 안된다.

'프로그램 사용 > docker' 카테고리의 다른 글

docker cassandra  (0) 2019.04.22
docker-compose up/down 주의사항  (0) 2019.03.24
docker cassandra selinux  (0) 2019.03.20
centos docker compose iptable error  (2) 2019.03.20
docker inspect  (0) 2019.02.28
Posted by 구차니