Skip to content

Commit ec1e573

Browse files
riyadparvezcalberti
authored andcommitted
Reduced size of Docker image (tensorflow#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 <[email protected]>
1 parent 65b23f9 commit ec1e573

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

syntaxnet/Dockerfile

+4-4
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ RUN mkdir -p $SYNTAXNETDIR \
1515
&& ./bazel-0.2.2b-installer-linux-x86_64.sh --user \
1616
&& git clone --recursive https://github.com/tensorflow/models.git \
1717
&& cd $SYNTAXNETDIR/models/syntaxnet/tensorflow \
18-
&& echo "\n\n\n" | ./configure
19-
20-
RUN cd $SYNTAXNETDIR/models/syntaxnet \
21-
&& bazel test --genrule_strategy=standalone syntaxnet/... util/utf8/... \
18+
&& echo "\n\n\n" | ./configure \
2219
&& apt-get autoremove -y \
2320
&& apt-get clean
2421

22+
RUN cd $SYNTAXNETDIR/models/syntaxnet \
23+
&& bazel test --genrule_strategy=standalone syntaxnet/... util/utf8/...
24+
2525
WORKDIR $SYNTAXNETDIR/models/syntaxnet
2626

2727
CMD [ "sh", "-c", "echo 'Bob brought the pizza to Alice.' | syntaxnet/demo.sh" ]

0 commit comments

Comments
 (0)