Car accidents happen each year. Some people died, while others survived. We are interested to know why people get such different results so we are going to examine the factors influencing severity of…
I remember when I learned about Makefiles from a mentor of mine. He pointed out the magic really happens because of targets and their relationship to actual files. Over time, writing efficient Makefiles that would avoid repeating work became more natural. At the same, I found that my Makefiles became more complex and difficult to follow. The problem usually revolves around declaring dependencies while trying to maintain some level of usability. The fact of the matter is, implicit dependencies are hard to define reliably, therefore you are stuck with explicit dependency definition no matter what.
This isn’t a criticism as much as evidence that dependencies are really hard over time. A generic tool like Make is nice because it provides simple facilities via the filesystem to cross different platform boundaries. If you don’t want to rebuild your Docker container unless some files change, then you can do that.
The (hopefully) obvious problem with this is that you have to manually extract most dependencies from the respective platform. In this case, build/*
and config/*
are likely paths that get included in your Dockerfile that you needed to define explicitly in the Makefile. There are likely ways to get around this with a little scripting that findCOPY
and ADD
in the Dockerfile, but that is more code that needs to be understood when defining targets. If you saw something like the following, would you understand what it did?
That doesn’t reflect things like when someone uses a script in a Dockerfile that might also use dependent files or should be considered when rebuilding the container. We haven’t even considered when the base container has changed or something is making network requests.
Most folks just punt and keep it simple. They rebuild all the time and deal with the waiting. I think that is reasonable. At the same time, when I’m iterating on a problem and have to push over and over to deploy something, the feedback loop is terrible. Not only do I lose focus, I feel like I’m wasting time and that makes me, literally, sad.
We are delighted to share a blog written by student Dilara Isik from Kultur2000 College, who is part of a team delivering a Global Goals project for the 2019–20 Global Goals Competition. Their…