While I’m working with docker I use a handful of commands: build this project, run it with certain environment variables, remove the image/container. First I tried writing shell scripts to prevent me for typing this commands over and over. But the disadvantages are clear: I had quickly a bunch of scripts and I could not commit this scripts to our VCS because all this scripts were to much coupled to my setup.
After a while thinking I came up with this solution: I have a base Makefile that includes a configuration file which is ignored by the VCS. This way everyone profit from the handy make commands like
make run etc. but all my colleagues can configure their own setting.
Here the Makefile template (thanks to @blang for the initial template)
and don’t forget to place an env_make file next to your Makefile that is ignored by the VCS: