Number of commands in Dockerfile
docker
Solution
As Alister said, there is an upper limit on the number of layers in a Docker image if you are using the AUFS file system. At Docker version 0.7.2 the limit was raised to 127 layers (changelog).
Since this a limitation of the underlying union file system (in the case of AUFS), using Quay or other private registries won't change the outcome. But you could use a different file system.
The current alternative filesystem is to use `devicemapper` (see CLI docs). These other filesystems may have different limitations on the number of layers -- I don't think devicemapper has an upper limit.
You're right, by RUNning multiple commands in a single RUN statement, you can reduce the number of layers.
Alternatively, if you really need a lot of layers to build your image, you could build an image until it reaches the maximum and then use `docker export` to create an un-layered copy of the image's file system. Then `docker import` to turn it back into an image again, this time with just one layer, and continue building. You lose the history that way though.
Problem
I noticed that each line in the Dockerfile creates a separate image. Is there any limit on the number of images that are created? Should we try to do a oneliner of `RUN cmd1 && cmd2 && cmd3` instead? How would this differ if we use a service like Quay? Thanks!