參考:https://www.cnblogs.com/shijf/p/10386193.html
https://www.cnblogs.com/myfqm/p/13086125.html
https://www.cnblogs.com/zhuochong/p/10070516.html
1、停止容器,然后找到容器的對應配置文件:/var/lib/docker/containers/[hash_of_the_container]/hostconfig.json
2、修改后保存(如修改端口綁定:PortBindings、重啟策略:RestartPolicy)
3、重啟 docker:systemctl restart docker
4、通過 docker inspect [hash_of_the_container] 命令可以查看當前容器的配置
5、通過 docker update --restart always [hash_of_the_container] 可以直接修改容器的重啟策略