I have been playing around with creating docker files and reading the documentation and I was wondering this question: Does adding an EXPOSE
command to my Doc
All instructions create new layers, but instructions that do not change the filesystem will create a layer that is empty.
It's worth looking into how Docker's filesystem layering works which you can read about here or here for AUFS.
Essentially new layers on the file system are made of those files that have changed from the layer below them, it's like a stack of diffs. As such, if there is no change, there is no layer to make. Mostly...
Every instruction in a Dockerfile will create an image layer, but for AUFS (in the case of EXPOSE
) that layer will be empty (no difference between it and the one below it).