3 ms·
Oh, what are the advantages of doing that in a different container as opposed to a different layer? Trying to understand the pros/cons.. Isn't it faster to add
by orliesaurus 8y ago
Oh, what are the advantages of doing that in a different container as opposed to a different layer? Trying to understand the pros/cons..
Isn't it faster to add extra layers, than extra containers?
- wolfgang42 8y agoDifferent layer means you have to carry around that layer in your final image. If you do a multi-stage build, you can copy over just the bits you need into the final image.
- vsviridov 8y agoLayers are add only. If you removea file, it still exists in the parent layer, propagating bloat
- heroic 8y agoThis is the builder pattern in docker. You do things in one "throw away" container, use results from this container and copy them into another. The final container gets only one layer now, instead of maybe 10s that your "throw away" container had.