support/docker: limit the number of layers
authorYann E. MORIN <yann.morin.1998@free.fr>
Sun, 4 Feb 2018 14:44:22 +0000 (15:44 +0100)
committerPeter Korsgaard <peter@korsgaard.com>
Sun, 4 Feb 2018 20:52:03 +0000 (21:52 +0100)
commit7517aef4dcfbf6ae298f41f3ddd1187523b016e5
treeeecafd095bcfa084839c2949fea644f6499d0fd8
parent9c267b4967e8d0831a35ea5d1d6ceddc4c38a813
support/docker: limit the number of layers

The official documentation [0] suggests limiting the number of layers
generated from a dockerfile. A layer is created for each RUN (and COPY
and ADD) command. But we are only ever interested in the final image,
so the intermediate layers are useless to us.

Limit the number of RUN commands to limit the number of generated
layers.

[0] https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#minimize-the-number-of-layers

Reported-by: Peter Korsgaard <peter@korsgaard.com>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Peter Korsgaard <peter@korsgaard.com>
Cc: Arnout Vandecappelle <arnout@mind.be>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
support/docker/Dockerfile