Tagging Docker images for fun and profit
happyvalley.dev
happyvalley.dev
The image version in my case is a tracker of the last-known-good-set (of various ingredients) - as validated by the quick, pre-build tests.
I haven't had any major problems till now; may be I am just lucky to not have encountered the hassles w.r.t calver till now.
I stumbled upon one similar approach too, recently. https://worklifenotes.com/2020/02/27/automatic-version-incre...
https://github.com/opencontainers/image-spec/blob/master/spe...
Docker considers it experimental but buildah doesn’t.
https://docs.docker.com/engine/reference/commandline/manifes...
https://github.com/containers/buildah/blob/master/docs/build...
How does Docker help you know your production code is like your development code? _Maybe_ for the code itself, but I highly doubt it, because you probably have different build targets for dev and production, different ports, networking, environment variables, asset serving, debugging, etc. And certainly the docker-compose, maybe Swarm, setup you run locally looks nothing like production? And of course your databases and other services are set up completely different locally.
* There are two networking stacks. Developers only see and care about the "inner" stack while the ops team is free to do anything to the "outer" or real network. Devs never see that the ports are actually different in prod.
* All the "environment" has to be passed explicitly. You can't accidentally depend on variables, files, programs, libraries, that just happen to be on the host system. Simultaneously, the ops team is now free to configure and manage or change the host system in any way they see fit.
* Devs only care that they're deploying to a swarm not any of the details of how that swarm exists in prod.
* Devs see shared storage just appear in their containers. To them it doesn't matter in the slightest that it comes from NFS, Gluster or Ceph.
* Devs just see traffic hit their app. They don't know or care anything about our LB or caching setup.
* Logs and metrics are sent to magic addresses and names on the inner network that map to the real vms outside.
* Same with the DB, Redis, Memcache, Queues, etc..
I am a bit scared by these devs only caring about themselves
Also Git provides a `git describe` command, that builds a short identifier including a incrementing number and the commit hash (as well as the last tag). It's standard enough and used by a lot of people (e.g. Linux distros). It has the benefit of being instantly parsable by Git. What's wrong with that?
Use hours, minutes and seconds?
And if you have a git checkout around, you can use git commit timestamp - time up to seconds and does not need anything except the source tree.