3 ms·
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
by kvnhn 4y 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/e98de8fcdf7ad564d4088fd49ef4063a0e38793a/Makefile#L36 https://github.com/kevin-hanselman/dud/blob/e98de8fcdf7ad564...
- jfkimmes 4y agoI 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?