docker 运行容器碰到的坑Docker 出错 docker: Error response from daemon: OCI runtime create failed: container_li

build成功后运行,报错:

docker: Error response from daemon: OCI runtime create failed: container_linux.go:348: starting container process caused "exec: \"docker-entrypoint.sh\": executable file not found in $PATH": unknown.
ERRO[0000] error waiting for container: context canceled 

 报错信息为 docker-entrypoint.sh 执行文件找不到,经过一番折腾,发现在build镜像时docker-entrypoint.sh没有执行权限。

解决办法:

1、更改文件权限

# chmod +x docker-entrypoint.sh

2、重新build镜像

# docker build -t postgres:10.3 

3、运行容器

# docker run postgres:10.3

 

注意:重点是先赋权限,镜像也要重新build 缺一不可!

你可能感兴趣的:(docker)