Error response from daemon: OCI runtime create failed: container_linux.go:348
时间: 2023-09-21 19:04:22 浏览: 155
引用中的报错信息是"Docker: Error response from daemon: OCI runtime create failed: container_linux.go:318: starting container process caused "chdir to cwd ("/tmp/project") set in config.json failed: no such file or directory": unknown. time="2023-05-10T15:37:43 08:00" level=error msg="error waiting for container: context canceled"。"
这个报错可能是由于容器在创建过程中失败导致的。报错中提到的container_linux.go文件以及相关的错误信息表明可能是容器的配置文件或路径设置有问题。
解决这个问题的方法可以参考引用和提供的信息。可以尝试以下步骤来解决该错误:
1. 检查容器的配置文件(config.json)中的路径设置是否正确,特别是/tmp/project是否存在。确保路径设置正确。
2. 检查系统内核和显卡驱动是否有更新。如果有更新,可能导致版本不一致并删除了某些依赖文件。可以尝试更新系统和显卡驱动。
3. 根据操作系统类型,执行相应的命令来安装nvidia-container-toolkit并重新启动Docker服务。对于Ubuntu系统,可以使用以下命令:
```
sudo apt-get update && sudo apt install nvidia-container-toolkit
sudo systemctl restart docker
```
对于Centos系统,可以使用以下命令:
```
distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.repo | sudo tee /etc/yum.repos.d/nvidia-docker.repo
yum update
yum install -y nvidia-container-toolkit
sudo systemctl restart docker
```
4. 如果需要在容器中共享宿主机的显卡,可以使用以下命令创建容器:
```
sudo docker run -it --gpus all --shm-size 20g nvidia/cuda:11.4.0-cudnn8-devel-ubuntu18.04 /bin/bash
```
通过执行上述步骤,您应该能够解决报错"Error response from daemon: OCI runtime create failed: container_linux.go:348"。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [docker: Error response from daemon: OCI runtime create failed: container_linux.go:318 no such file](https://blog.csdn.net/thlzjfefe/article/details/130605453)[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^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *2* [解决docker报错Error response from daemon oci runtime error_centos安装docker](https://download.csdn.net/download/lj_70596/14038620)[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^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *3* [docker: Error response from daemon: OCI runtime create failed: container_linux.go:367](https://blog.csdn.net/Darren_yy/article/details/131942758)[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^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"]
[ .reference_list ]
阅读全文