3 ms·
I took over a Dockerfile that called out to ansible for all the heavy lifting, presumably because that's what the authors knew and liked. Translating to indivi
by tln 8y ago
I took over a Dockerfile that called out to ansible for all the heavy lifting, presumably because that's what the authors knew and liked.
Translating to individual RUN lines removed 100s of lines of code, and vastly sped up the build process. In addition the build process should be more familiar to future Dockerfile devs, who can see the entire build in one file and don't need to learn an extra tool.
Wrt this project, how well does it use Dockers build cache? And is it really better than idiomatic Dockerfile when you account for future developers?
- d3ck 8y agoBuild cache is supported (https://bit.ly/2S8Z3oi https://bit.ly/2S8Z3oi), it's the job of the user to structure his code wisely (same as with docker RUN commands). And: No, it's not "better", it's a different approach. Like most/any other community solution it will not replace the standard Dockerfile process :)
- tln 8y agoThanks for the link
- jzelinskie 8y agoFWIW, there was an "official" project for Ansible to generate container images, but it's constantly in limbo. While I do think this is reasonable, I have an intuition that you might be trying to do too much in one image, if you feel like you need Ansible. There are good reasons to sometimes have fat-containers. Do you mind sharing what all you're installing with Ansible?
- tln 8y agoIt's a Django backend: the dockerfile uses apt-get and pip. Pretty simple. Using ansible from a Dockerfile in the first place was a code smell, IMO.