Loading... ## 1. docker设置开机自启 ```bash systemctl enable docker.service ``` ## 2. docker容器设置开机自启 #### 2.1 新建容器时配置自启参数 ```bash docker run --restart=always 容器id 或 容器名称 ``` #### 2.2 已存在的容器配置自启 ```bash docker update --restart=always 容器id 或 容器名称 ``` #### 2.3 批量设置容器自启 ```bash docker update --restart=always $(docker ps -aq) ``` #### 2.4 取消容器自启 ```bash docker update --restart=no 容器id 或 容器名称 ``` Last modification:June 27, 2022 © Allow specification reprint Support Appreciate the author AliPayWeChat Like 0 感谢大佬投喂 啾咪~