光线
docker-compose 启动报错:OCI runtime create failed
完整报错:
text
Cannot start service touty-ui: OCI runtime create failed: container_linux.go:349: starting container process caused "process_linux.go:319: getting the final child's pid from pipe caused \"EOF\"": unknown释放一次页缓存即可:
bash
sysctl -w vm.drop_caches=1docker-compose 启动报错:An HTTP request took too long to complete
完整报错:
text
An HTTP request took too long to complete. Retry with --verbose to obtain debug information.
If you encounter this issue regularly because of slow network conditions, consider setting COMPOSE_HTTP_TIMEOUT to a higher value (current value: 60).信息
大概有下面四种方法
- 观察想要up的容器是否在Created状态,可以尝试先删除掉这个容器重新创建
- 重新安装docker-compose
bash
curl -L https://get.daocloud.io/docker/compose/releases/download/1.24.0/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose- 追加COMPOSE_HTTP_TIMEOUT变量,并把值调大
bash
vim /etc/profile
====================================================================================================================================================
export COMPOSE_HTTP_TIMEOUT=500
export DOCKER_CLIENT_TIMEOUT=500
====================================================================================================================================================
source /etc/profile- 删除些许容器
Java 容器启动报错:unable to allocate file descriptor table
完整报错:
text
library initialization failed - unable to allocate file descriptor table找到 docker.service 文件,在 ExecStart=/usr/bin/dockerd 后面添加 --default-ulimit nofile=65536:65536 参数
信息
service文件一般在 /etc/systemd/system/ 或者 /usr/lib/systemd/system/
容器执行完 Dockerfile 里的操作就退出
不管是docker run或者docker-compose启动一个镜像时:如果你的预期是这个容器开启某个服务或者其他原因,需要这个容器一直在运行,但是实际执行完dockerfile里所写的所有操作就退出。
最后一条命令的操作对象是脚本
首先要看你的dockerfile是不是最后一条命令或者操作的对象是一个Shell脚本或者其他脚本。如果是的话,以Shell脚本为例,可以在shell脚本的最后一行添加一条tail或者top操作,使这个脚本永远不会结束
操作对象不是脚本文件
可以试着在Docker-Compose文件中添加tty: true配置项