Hacker News new | ask | show | jobs
by cweiss 3071 days ago
Yes, but the real win is in a different way than I think you're describing. With Docker, containers are built in a layered fashion with each 'step' of the build creating a new layer (think version control hashes). The benefit here is twofold:

First - If your change to the container is near the end of the build process (see earlier comment about smart container design), then the rebuild will only change the final few hashes and Docker is smart enough to not rebuild earlier hashes.

Second - Hashes are global, so if you have multiple containers that start with the same base (say, Alpine Linux + Python + NMP + etc.), Docker will share existing hashed layers. This means a much smaller distribution payload.

To (what I think is) your original question - you can tag the 'final' container itself. Tagging it with the Git hash is one way to get exactly what you're talking about.