浏览代码

Reduced size of Docker image (#234)

As Docker builds are layer by layer, removing cached package files in different layers do not reduce image size. To reduce image size, cached packages have to removed in the same layer i.e., `RUN` command as the packages have been installed.

Signed-off-by: Riyad Parvez <social.riyad@gmail.com>
Riyad Parvez 9 年之前
父节点
当前提交
ec1e5734e9
共有 1 个文件被更改,包括 4 次插入4 次删除
  1. 4 4
      syntaxnet/Dockerfile

+ 4 - 4
syntaxnet/Dockerfile

@@ -15,13 +15,13 @@ RUN mkdir -p $SYNTAXNETDIR \
     && ./bazel-0.2.2b-installer-linux-x86_64.sh --user \
     && git clone --recursive https://github.com/tensorflow/models.git \
     && cd $SYNTAXNETDIR/models/syntaxnet/tensorflow \
-    && echo "\n\n\n" | ./configure
-
-RUN cd $SYNTAXNETDIR/models/syntaxnet \
-    && bazel test --genrule_strategy=standalone syntaxnet/... util/utf8/... \
+    && echo "\n\n\n" | ./configure \
     && apt-get autoremove -y \
     && apt-get clean
 
+RUN cd $SYNTAXNETDIR/models/syntaxnet \
+    && bazel test --genrule_strategy=standalone syntaxnet/... util/utf8/...
+
 WORKDIR $SYNTAXNETDIR/models/syntaxnet
 
 CMD [ "sh", "-c", "echo 'Bob brought the pizza to Alice.' | syntaxnet/demo.sh" ]