OCI runtime create failed: container_linux.go:345: starting container process caused “exec: \“pip\“

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

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
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

szZack

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值