I'm deploying a flask application on google cloud run but I'm facing issue regarding installation on dlib library. dlib started to install then it goes to loop to build dlib wheel then after some time it throws an error. CMake libray is already installed successfully.
Here is the 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
Here is the error
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