【发布时间】:2023-03-08 19:35:01
【问题描述】:
我正在 google cloud run 上部署一个烧瓶应用程序,但我遇到了关于在 dlib 库上安装的问题。 dlib 开始安装,然后进入循环构建 dlib 轮,然后在一段时间后抛出错误。 CMake 库已经安装成功。
这里是 Dockerfile
# Use the official lightweight Python image.
# https://hub.docker.com/_/python
FROM python:3.8-slim
# Allow statements and log messages to immediately appear in the Knative logs
ENV PYTHONUNBUFFERED True
# Copy local code to the container image.
ENV APP_HOME /app
WORKDIR $APP_HOME
COPY . ./
# Install production dependencies.
#RUN apt-get update && apt-get install -y cmake
#RUN sudo apt-get update && sudo apt-get install build-essential
#RUN apt-get update && apt-get install build-essential cmake
RUN apt update && apt install -y gcc clang clang-tools cmake python3
RUN pip install dlib
RUN pip install --no-cache-dir -r requirements.txt
RUN pip install gunicorn
# Run the web service on container startup. Here we use the gunicorn
# webserver, with one worker process and 8 threads.
# For environments with multiple CPU cores, increase the number of workers
# to be equal to the cores available.
# Timeout is set to 0 to disable the timeouts of the workers to allow Cloud Run to handle instance scaling.
CMD exec gunicorn --bind :$PORT --workers 1 --threads 8 --timeout 0 main:app
这是错误
Building wheels for collected packages: dlib, face-recognition-models
Building wheel for dlib (setup.py): started
Building wheel for dlib (setup.py): still running...
Building wheel for dlib (setup.py): still running...
Building wheel for dlib (setup.py): still running...
Building wheel for dlib (setup.py): still running...
Building wheel for dlib (setup.py): still running...
Building wheel for dlib (setup.py): still running...
Building wheel for dlib (setup.py): still running...
ERROR
ERROR: build step 0 "gcr.io/cloud-builders/docker" failed: step exited with non-zero status: 2
【问题讨论】:
标签: python google-cloud-platform gcloud google-cloud-run dlib