在我的Dockerfile中pip install requirements.txt
步骤期间,Google Cloud Shell会断开连接。错误消息是:
The connection to your Google Cloud Shell was lost.
错误前的日志是:
Step 3 : WORKDIR /app
---> Running in fd690eb34995
---> 565d7a3d5ce1
Removing intermediate container fd690eb34995
Step 4 : RUN pip install -r requirements.txt
---> Running in 18e2513dcbe8
Collecting Flask (from -r requirements.txt (line 1))
Downloading Flask-0.12.2-py2.py3-none-any.whl (83kB)
Collecting pandas (from -r requirements.txt (line 2))
Downloading pandas-0.20.1-cp27-cp27mu-manylinux1_x86_64.whl (22.3MB)
Collecting numpy (from -r requirements.txt (line 3))
Downloading numpy-1.12.1-cp27-cp27mu-manylinux1_x86_64.whl (16.5MB)
Collecting scipy (from -r requirements.txt (line 4))
Downloading scipy-0.19.0-cp27-cp27mu-manylinux1_x86_64.whl (45.0MB)
然后我尝试重新连接,但我的图像从未创建过。我的Dockerfile如下:
# Use an official Python runtime as a base image
FROM python:2.7-slim
# Copy the current directory contents into the container at /app
ADD . /app
# Set the working directory to /app
WORKDIR /app
# Install any needed packages specified in requirements.txt
RUN pip install -r requirements.txt
# Make port 80 available to the world outside this container
EXPOSE 8080
# Define environment variable
ENV NAME World
# Run app.py when the container launches
CMD ["python", "app.py"]
我的requirements.txt文件包含:
Flask
pandas
numpy
scipy
scikit-learn
为什么在我的Dockerfile中运行步骤pip install requirements.txt
时,我失去了与Google Cloud Shell的连接?