在发布nginx的时候失败,异常如下:
/usr/bin/docker-current: Error response from daemon: oci runtime error: container_linux.go:235: starting container process caused "container init exited prematurely".
在发布nginx的时候,失败,原因是 -v 映射的文件夹不存在。
- 更新yum
这种方案不是我提出来的,我一般都是先更新yum,命令如下:
yum install
- 创建 -v 映射的文件夹。创建容器的命令如下:
docker run -d --name web-argo -p 1246:80 --privileged=true -v /home/vue/conf/argo.conf:/etc/nginx/conf.d/default.conf -v /home/vue/release/argo/:/usr/share/nginx/html nginx:latest
创建文件夹的命令如下:
mkdir /home/vue/release/argo/
vi argo.conf
至此问题解决,重新启动即可,如果依然无法启动,删除容器,重新创建容器,首先要保证 -v 中的文件及文件夹存在。
docker 发布容器异常问题缘原因解决方案缘在发布nginx的时候失败,异常如下:/usr/bin/docker-current: Error response from daemon: oci runtime error: container_linux.go:235: starting container process caused "container init exited prematurely".原因在发布nginx的时候,失败,原因是 -v 映射的文件夹不存在。解决方案更
1,在运行容器的时候,给容器加特权:
示例:docker run -i -t --privileged=true -v /home/docs:/src waterchestnut/nodejs:0.12.0
2,临时关闭selinux:
示例:su -c "setenforce 0"
之后执行:docker run -i -t -v /home/docs:/src waterchestnu...
docker 启动容器报错:Error response from daemon: oci runtime error: container_linux.go:247: starting container process caused “write parent: broken pipe”
其实原因还是,linux与docker版本的兼容性问题
第一步:通过uname -r命令查看你当前的内核版本
uname -r
第二步:使用 root 权限登录 Centos。确保 yum 包更新到最新。
docker run -it --name ubuntu -v d:\okok\from:/home/to ubuntu:18.04
有位博主说TA可以,但我被报错Error response from daemon: invalid mode
docker run -it --name ubunt