In a previous post (meet the packs) we saw that there’s more than one way to make your packs generic and avoid the dreaded copy-and-paste syndrome. In particular, environment variables can come to the rescue, but this comes at a cost: whenever you define an environment variable when calling Docker, and save the container, it’s there to remain (unless overridden, of course). Do we really need this?
Did you think that the previous post on Dibs packs had all there is to know about packs? Surely not!
This is the first post about dibs (first here and second here) and it should be clear by now that the main goal of Dibs (at least “over” using a plain Dockerfile) is reuse. This time we take an introductory look at packs, which per-se allow easily reusing stuff in a slightly less copy & paste way; we will see in a future installment how this can be further leveraged for a more modern way of sharing and reusing things.
In our first post about dibs we saw how to use it as a different kind of multistage Dockerfile. While I already prefer it this way (all the &&s quickly annoy me), a lot revolves around reuse.