OCI runtime create failed: container_linux.go:345: starting container process caused "exec: \"pip\": executable file not found in $PATH": unknown
Docker Dockerfile
Dockerfile 是一个用来构建镜像的文本文件,文本内容包含了一条条构建镜像所需的指令和说明。
本文在制作 BERT 文本分类模型镜像时,碰到的 docke build 的 pip 错误:
OCI runtime create failed: container_linux.go:345: starting container process caused “exec: “pip”: executable file not found in $PATH”: unknown
Dockefile 制作镜像
使用 pip 安装依赖包:
pip install -r /home/bert_model/requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
写成 Dockefile 的命令:
RUN ["pip", "install", "-r", "/home/bert_model/requirements.txt", "-i", "https://pypi.tuna.tsinghua.edu.cn/simple"]
Dockefile:
FROM refazul/python3.9.0
ADD bert_model.tar /home
RUN ["pip", "install", "-r", "/home/bert_model/requirements.txt", "-i", "https://pypi.tuna.tsinghua.edu.cn/simple"]
ENTRYPOINT ["bash", "/home/bert_model/run.sh"]
创建镜像
docker build -t ber

文章讲述了在使用Dockerfile构建BERT文本分类模型镜像时遇到的ociruntimecreatefailed错误,通过创建测试容器查找并修改pip路径解决了问题,关键步骤包括检查pip位置并将其添加到Dockefile的RUN指令中。
最低0.47元/天 解锁文章
77

被折叠的 条评论
为什么被折叠?



