[英]Failed building wheel for grpcio - docker-compose. Python project
Try to build docker-compose container on host machine.尝试在主机上构建 docker-compose 容器。 The problem with grpcio , which fails all the time. grpcio的问题,它一直失败。 Error:错误:
distutils.errors.CompileError: command '/usr/bin/gcc' failed with exit code 1
ERROR: Failed building wheel for grpcio
With VERY big traceback有非常大的追溯
Interesting that on my laptop there are no any problems with it.有趣的是,在我的笔记本电脑上没有任何问题。 Container works well.容器运行良好。
I have tried (language - Python):我试过(语言 - Python):
Dockerfile: Dockerfile:
FROM python:3.9.4-alpine
WORKDIR /usr/src/project
# Create the app user
RUN addgroup -S project && adduser -S project -G project
ENV HOME=/home
ENV APP_HOME=/home/api
RUN mkdir $APP_HOME
RUN mkdir $APP_HOME/static
RUN mkdir $APP_HOME/media
WORKDIR $APP_HOME
RUN chown -R project:project $APP_HOME
RUN apk add --update --no-cache tiff-dev jpeg-dev openjpeg-dev zlib-dev freetype-dev lcms2-dev \
libwebp-dev tcl-dev tk-dev harfbuzz-dev fribidi-dev libimagequant-dev libxcb-dev libpng-dev \
gcc build-base freetype-dev libpng-dev openblas-dev \
postgresql-dev gcc python3-dev musl-dev
RUN pip3 install --upgrade pip
RUN pip3 install setuptools==49.6.0
COPY requirements.txt ./
RUN pip3 install -r requirements.txt
COPY . .
I still dont know how to fix this error.我仍然不知道如何解决这个错误。 But i have found the solution for this situation.但我已经找到了解决这种情况的方法。 I build doker image on local machine, push it to docker hub.我在本地机器上构建了 docker 镜像,将其推送到 docker hub。 On host machine, pulled from docker and changed docker-compose.yml file to use existing image instead of build new one.在主机上,从 docker 拉取并更改 docker-compose.yml 文件以使用现有图像而不是构建新图像。 Technically problem solved, but it`s still curious why i got this error.技术上问题解决了,但仍然很好奇为什么我会收到这个错误。
Edited reinstall OS on host machine.在主机上编辑重新安装操作系统。 Now its Ubuntu 20.04.现在是 Ubuntu 20.04。 No problem anymore没问题了
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.