启动docker镜像
时间: 2023-10-08 16:05:22 浏览: 82
启动docker镜像可以使用以下命令:
1. 加载镜像文件:docker load -i [镜像文件名.tar]
2. 查看镜像列表:docker image ls
3. 运行容器:docker run -itd [镜像名 --name [容器名]
4. 查看容器ID:docker ps
5. 执行容器命令:docker exec -it [容器ID bash
6. 在宿主机拷贝文件到容器:docker cp [宿主机文件路径 [容器名]: [宿主机文件路径]
8. 停止容器:docker stop [容器名或ID]
9. 启动容器:docker start [容器名或ID]
10. 杀死容器:docker kill [容器名或ID]
11. 重启容器:docker restart [容器名或ID [2]
如果使用docker-compose启动容器,可以通过编写docker-compose.yml文件来定义服务以及其配置,然后使用docker-compose命令启动容器。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [【docker基础操作命令】(一)启动命令和镜像命令](https://blog.csdn.net/weixin_43598687/article/details/124637938)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *2* [启动docker镜像](https://blog.csdn.net/m0_67402013/article/details/126565374)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *3* [Docker 启动镜像的方法](https://blog.csdn.net/bocai_xiaodaidai/article/details/92969756)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
[ .reference_list ]
阅读全文