Docker错误:由于Oserror而无法安装软件包:[Errno 2]
大家好,当我尝试Docker Image build -t Py -Test
错误:由于Oserror而无法安装软件包:[ERRNO 2]没有这样的文件或目录:'// tmp/tmp_ohy_f6g/output.json'
执行人失败运行[/bin/sh -c pip install IBM -db]:退出代码:1
dockerfile:
FROM python:3.9.13-alpine3.16
WORKDIR /app
RUN pip install --upgrade setuptools
RUN pip install --upgrade pip
RUN pip install ibm-db
RUN pip install flask
EXPOSE 8080
COPY . .
CMD ["python", "output.py"]
docker版本: docker版本20.10.16,构建AA7E41414141414141414
MacOS(Localhost)版本 - MacOS Montery版本12.4(21F79)
hey guys getting this error when i try to docker image build -t py-test
ERROR: Could not install packages due to an OSError: [Errno 2] No such file or directory: '/tmp/tmp_ohy_f6g/output.json'
executor failed running [/bin/sh -c pip install ibm-db]: exit code: 1
dockerfile:
FROM python:3.9.13-alpine3.16
WORKDIR /app
RUN pip install --upgrade setuptools
RUN pip install --upgrade pip
RUN pip install ibm-db
RUN pip install flask
EXPOSE 8080
COPY . .
CMD ["python", "output.py"]
Docker version 20.10.16, build aa7e414
macOS (localhost) version -- macos montery version 12.4 (21F79)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
更多
发布评论
评论(1)
使用
pip
以详细模式运行构建(pip install -v ibm-db
)后,您可以看到以下错误:ibm-db
要求您在安装它时具有可用的GCC
,以便您可以构建其C模块。安装
gcc
和libc-dev
ibm-db
解决问题:After running the build with
pip
in verbose mode (pip install -v ibm-db
), you can see the following error:ibm-db
requires you to havegcc
available when installing it, so that you can build it's C modules.Installing
gcc
andlibc-dev
beforeibm-db
solves the issue: