說明:適用於yum安裝的各類服務docker
systemctl list-units --type=service
systemctl list-unit-files | grep enable
systemctl enable docker.service
systemctl disable docker.service
docker run -tid --name isaler_v0.0.11 -p 8081:8080 --restart=always -v /alidata/iDocker/run/projectImages/isaler/v0.0.11/log:/usr/local/tomcat/logs isaler_v0.0.11 Flag Description no 不自動重啓容器. (默認value) on-failure 容器發生error而退出(容器退出狀態不爲0)重啓容器 unless-stopped 在容器已經stop掉或Docker stoped/restarted的時候才重啓容器 always 在容器已經stop掉或Docker stoped/restarted的時候才重啓容器
若是已經啓動的項目,則使用update更新: docker update --restart=always isaler_v0.0.11