We use make for standardizing the way docker containers are built, pushed, tested, and run (debug and production modes). I even prefer it to docker-compose at this point, because it is more programmable.
Do you handle dependencies (images, networks, volumes), and if you do - how?
I'm of an opinion that Makefiles with Docker are mostly a fancy way to write `case "$1" in build) ... run) ... esac` except that one needs to have make(1) installed to run them (in my experience, Bourne shell is much more commonly available than any make variant)
I've generally had to only do this for more-or-less stand alone webservices, but there's nothing preventing making extra targets for setting up networks. To date, I'm still using docker compose for that.
I started doing makefiles as a reaction to having a bunch of bash scripts cluttering up my directory. More or less just a collection of useful commands. But as I continue to do this, I find it encourages making consistent build routines/versioning. Also, being able to set up dependencies ( like "run relies on build") can also be helpful. Finally, variable substitution is useful for versioning.
I think what makes makefiles great are you can do as much or as little as you want with them. I put an example of a common one in another reply.
- I do major.minor.yy-mm-dd versioning, so this handles that automatically
- shell is for dropping you into a prompt with your present directory mapped to the working directory. I find this super helpful for debugging and testing containers
- run is for testing your CMD and entrypoint scripts
Not the OP, doing a bit less that it sounds like the OP is doing, but we built out a relatively handy make-based build system for building a set of images in correct dependency order.
Another member of the team subsequently taught make about the reverse dependencies so that you can split jobs across Travis nodes by the top-ish level image they depend on.
My favorite addition was the ability to generate a dependency graph using graphviz straight from the Dockerfiles.
N.B. Project is now moribund, the team was disbanded. May not build at all. Don't know if any of the forks are active.
That's pretty interesting about Travis. Make is great because you can do as much or as little with it as you want, but it generally always improves organization.
Thanks for chiming in. That all sounds very interesting and this thread has got my gears turning.
I regret not considering Make for Docker administration months/years ago. I've taken to using bash scripts or, worse, tagged bash comments to recall commonly used complex commands.