Hacker News new | ask | show | jobs
by kvnhn 1422 days ago
I don't know about replacing Make with Docker, but I use the two together to good effect. One of my favorite hacks is adding a 'docker-%' rule in my Makefile to run make commands in a Docker image[1]. It's a bit mind-bending, and there's a few gotchas, but it works surprisingly well for simple rules.

[1]: https://github.com/kevin-hanselman/dud/blob/e98de8fcdf7ad564...

1 comments

I toyed with a similar setup recently and I had the problem that I, too, would have rules depend on a "docker build"-step (like `docker-image` in your example). Usually `make` would stop building the dependency for non-PHONY targets if it finds the correct file but in this case it obviously cannot find anything.

I tried `touch`ing hidden files for each step and then add those as a dependency but that is not very elegant. Do you have this problem at all?