我正在谷歌管理的虚拟机上构建一个网络服务器,它使用 dockerfiles 来加载设置。在我的例子中,就是设置 opencv-python。
我已经使用“gcloud preview app run ./app.yaml”在本地服务器上成功测试了它,一切正常。
但是当我将它部署到谷歌应用引擎和 SSH 到 VM 实例时,它似乎没有运行 dockerfiles 中列出的命令。
问题 1:当实例正在构建 docker 映像时,有没有办法可以看到输出(日志记录)。日志记录在本地服务器上如下所示
Starting module "default" running at: http://localhost:8080
INFO 2015-03-20 17:43:34,777 containers.py:261] -------------------- DOCKER BUILD --------------------
INFO 2015-03-20 17:43:34,784 admin_server.py:118] Starting admin server at: http://localhost:8000
INFO 2015-03-20 17:43:34,957 containers.py:280] ---> 92880230fd9f
INFO 2015-03-20 17:43:34,958 containers.py:280] Step 1 : RUN apt-get update && apt-get install -y python-mysqldb
INFO 2015-03-20 17:43:35,076 containers.py:280] ---> Running in b27ba0e6693a
问题2:我的dockfiles中的任何错误
FROM google/appengine-python27
RUN apt-get update && apt-get install -y python-mysqldb
RUN apt-get update && apt-get install -y build-essential
RUN apt-get update && apt-get install -y cmake git libgtk2.0-dev pkg- config libavcodec-dev libavformat-dev libswscale-dev
RUN apt-get update && apt-get install -y python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev
RUN cd $HOME;git clone https://github.com/Itseez/opencv.git
RUN cd $HOME;git clone https://github.com/Itseez/opencv_contrib.git
RUN cd $HOME/opencv;mkdir build
RUN cd $HOME/opencv/build;cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local $HOME/opencv
RUN cd $HOME/opencv/build;make -j7
RUN cd $HOME/opencv/build;make install
RUN export PYTHONPATH=$PYTHONPATH:/usr/local/lib/python2.7/site-packages
ADD . /app