【发布时间】:2018-02-01 17:53:21
【问题描述】:
我正在尝试将我的模型部署到 tensorflow 服务。为此,我正在使用以下链接 https://towardsdatascience.com/how-to-deploy-machine-learning-models-with-tensorflow-part-2-containerize-it-db0ad7ca35a7 中的步骤创建 docker 映像。在创建 docker 映像时,构建在步骤 8/9 处停止。
下面是命令行界面
~/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
【问题讨论】:
-
如果你手动运行这些命令会发生什么?
-
当我尝试来自 Dockerfile.devel 的所有命令时,设置 bazel 的命令不起作用
-
这并不是问题的真正答案。我尝试自己手动运行命令,并注意到下载安装程序的时间很长,因为它的大小为 185M。您等待第 8 步完成多长时间?
-
首先将构建内容发送到 docker daemon 大约需要 1 分钟,然后在短短几秒钟内它会进入步骤 8/9 并卡住显示正在运行(某些 id)。
-
这也不是那个问题的答案。如果不知道其中任何一个,我不确定如何为您提供帮助。
标签: python docker tensorflow machine-learning tensorflow-serving