简体   繁体   English

Docker构建卡在步骤8/9

[英]Docker build stuck at step 8/9

I'm trying to deploy my model to tensorflow serving. 我正在尝试将我的模型部署到tensorflow服务。 for that i'm creating docker image by using the steps from the following link https://towardsdatascience.com/how-to-deploy-machine-learning-models-with-tensorflow-part-2-containerize-it-db0ad7ca35a7 . 为此,我正在使用以下链接https://towardsdatascience.com/how-to-deploy-machine-learning-models-with-tensorflow-part-2-containerize-it-db0ad7ca35a7的步骤创建docker映像。 While creating the docker image the build stops at step 8/9. 创建docker映像时,构建将在步骤8/9停止。

Below is the commandline screen 下面是命令行屏幕

~/serving$ docker build --pull -t $USER/tensorflow-serving-devel -f tensorflow_serving/tools/docker/Dockerfile.devel .
Sending build context to Docker daemon 1.239 GB
Step 1/9 : FROM ubuntu:16.04
16.04: Pulling from library/ubuntu
Digest: sha256:e27e9d7f7f28d67aa9e2d7540bdc2b33254b452ee8e60f388875e5b7d9b2b696
Status: Image is up to date for ubuntu:16.04
 ---> 0458a4468cbc
Step 2/9 : MAINTAINER Jeremiah Harmsen <jeremiah@google.com>
 ---> Using cache
 ---> 7bada30b20fe
Step 3/9 : RUN apt-get update && apt-get install -y         build-essential         curl         git         libfreetype6-dev         libpng12-dev         libzmq3-dev         mlocate         pkg-config         python-dev         python-numpy         python-pip         software-properties-common         swig         zip         zlib1g-dev         libcurl3-dev         openjdk-8-jdk        openjdk-8-jre-headless         wget         &&     apt-get clean &&     rm -rf /var/lib/apt/lists/*
 ---> Using cache
 ---> 57f9ee7ab8cb
Step 4/9 : RUN pip install mock grpcio
 ---> Using cache
 ---> 46db62fe343f
Step 5/9 : ENV BAZELRC /root/.bazelrc
 ---> Using cache
 ---> 4e1be28c3a58
Step 6/9 : ENV BAZEL_VERSION 0.5.4
 ---> Using cache
 ---> 22d8de897aa6
Step 7/9 : WORKDIR /
 ---> Using cache
 ---> fd083766a738
Step 8/9 : RUN mkdir /bazel &&     cd /bazel &&     curl -fSsL -O https://github.com/bazelbuild/bazel/releases/download/$BAZEL_VERSION/bazel-$BAZEL_VERSION-installer-linux-x86_64.sh &&     curl -fSsL -o /bazel/LICENSE.txt https://raw.githubusercontent.com/bazelbuild/bazel/master/LICENSE &&     chmod +x bazel-*.sh &&     ./bazel-$BAZEL_VERSION-installer-linux-x86_64.sh &&     cd / &&     rm -f /bazel/bazel-$BAZEL_VERSION-installer-linux-x86_64.sh
 ---> Running in 24465785bb05

You probably have to update the BASEL_VERSION in the docker file to the present version number. 您可能必须将docker文件中的BASEL_VERSION更新为当前版本号。 You can get the file at tensorflow_serving/tools/docker 您可以在tensorflow_serving / tools / docker上获取文件

I had the same issue and was able to resolve it by commenting out the Bazel build commands in the Dockerfile.devel file, and then running the same Bazel commands one by one afterwards. 我遇到了同样的问题,能够通过注释掉Dockerfile.devel文件中的Bazel构建命令,然后逐个运行相同的Bazel命令来解决该问题。

  1. Comment out the Bazel build commands in the Dockerfile.devel file 注释掉Dockerfile.devel文件中的Bazel构建命令

  2. docker build --pull -t $USER/tensorflow-serving-devel -f tensorflow_serving/tools/docker/Dockerfile.devel . docker build --pull -t $ USER / tensorflow-serving-devel -f tensorflow_serving / tools / docker / Dockerfile.devel。

  3. At this point, the docker container should be able to finish building. 至此,docker容器应该能够完成构建。 While inside the container, run the following commands to install Bazel. 在容器内时,运行以下命令以安装Bazel。

    mkdir /bazel mkdir / bazel

    cd /bazel cd / bazel

    curl -fSsL -O https://github.com/bazelbuild/bazel/releases/download/ $BAZEL_VERSION/bazel-$BAZEL_VERSION-installer-linux-x86_64.sh curl -fSsL -O https://github.com/bazelbuild/bazel/releases/download/ $ BAZEL_VERSION / bazel- $ BAZEL_VERSION-installer-linux-x86_64.sh

    chmod +x bazel-*.sh chmod + x bazel-*。sh

    ./bazel-$BAZEL_VERSION-installer-linux-x86_64.sh ./bazel-$BAZEL_VERSION-installer-linux-x86_64.sh

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM