google.cloud转换不适用于Docker(Python)

时间:2019-07-11 15:46:36

标签: docker google-translate

我是Docker的新手。

我有一个运行Google翻译API的类。它在本地运行。

Dockerfile:

FROM python:3.6.6-alpine3.8

# Project files
ARG PROJECT_DIR=/srv/api
RUN mkdir -p $PROJECT_DIR
WORKDIR $PROJECT_DIR

RUN apk add gcc musl-dev libffi-dev openssl-dev

# Install Python dependencies
COPY ./ ./
RUN pip install --upgrade pip
RUN pip install google-cloud-translate
RUN pip install -r requirements.txt

当我docker-compose build

时崩溃
 ERROR: Complete output from command /usr/local/bin/python -u -c 'import setuptools, tokenize;__file__='"'"'/tmp/pip-install-9k79v_vp/grpcio/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-3w3baynf --python-tag cp36:
  ERROR: Found cython-generated files...
  running bdist_wheel
  running build
  running build_py
  running build_project_metadata
  creating python_build
  creating python_build/lib.linux-x86_64-3.6
  creating python_build/lib.linux-x86_64-3.6/grpc
  copying src/python/grpcio/grpc/_server.py -> python_build/lib.linux-x86_64-3.6/grpc
<..>
ERROR: Command "/usr/local/bin/python -u -c 'import setuptools, tokenize;__file__='"'"'/tmp/pip-install-9k79v_vp/grpcio/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-vb12kr37/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-9k79v_vp/grpcio/

有什么想法吗?

1 个答案:

答案 0 :(得分:0)

  gcc: error trying to exec 'cc1plus': execvp: No such file or directory

您还需要安装g++