4 ms·
So I can write a Dockerfile using 17 verbs (13, actually), and it's understandable language to a 4th grader... or I can write 120 lines of complete abstract
by whydoineedthis 3y ago
So I can write a Dockerfile using 17 verbs (13, actually), and it's understandable language to a 4th grader... or I can write 120 lines of complete abstract nix code that means nothing to someone doing software for 20 years.
Hrmmmm...this is such a TOUGH decision.
- xena 3y agoI've used this app for like four different talks over the years, I could clean it up, but then I break code samples in my talks.
- m463 3y agoI would like to mention one pet peeve of mine wrt docker... cramming everything into one RUN line to save space in a layer. I really wish instead of: RUN foo && \ bar && \ bletch You could do: LAYER RUN foo RUN bar RUN bletch LAYER or something similar. maybe even during development you could do: docker build --ignore-layer . then at the end: docker build .
- viraptor 3y agoCramming things into one layer can save gigabytes in size. Even if it saves a 100MB, it adds up between multiple CI runs and in deployment latencies. Docker should address it one day, but until then, we just have to do it in real world scenarios.
- a_t48 3y agoParent comment agrees with you, is just asking for more ergonomic syntax
- viraptor 3y agoI get it, just providing more context. Should've phrased it nicer.
- yjftsjthsd-h 3y agoAn alternative solution... for some definition of the term... is to write a "naive" Dockerfile like RUN foo RUN bar RUN baz and then just build it with something like... I think kaniko did this last I looked?... that smashes the whole thing into a single layer. Obviously that has other tradeoffs (no reuse of layers) but depending on your usecase it can be a good trade to make (why yes, I did cut my teeth in an environment where very few images shared a base layer, why do you ask?).
- sre2 3y agoHeredocs (described in the docs[1] under "shell form") was introduced 3 years ago[1]. The flag '--squash' has been in podman for quite a while[2]. It might be time for you to upgrade your tooling. [0]: https://docs.docker.com/reference/dockerfile/#shell-form https://docs.docker.com/reference/dockerfile/#shell-form [1]: https://www.docker.com/blog/introduction-to-heredocs-in-dockerfiles/ https://www.docker.com/blog/introduction-to-heredocs-in-dock... [2]: https://docs.podman.io/en/latest/markdown/podman-build.1.html#squash https://docs.podman.io/en/latest/markdown/podman-build.1.htm...
- viraptor 3y agoI addressed the 120 lines already and they're not completely abstract. You seem uncomfortable with an alternative approach and that's fine. But this is not a good intentions argument.
- kaba0 3y agoDockerfile’s are absolutely not something a 4th grader would understand. It looks familiar to you, because you have already learnt it. They are definitely not trivial to understand before that, and the same is also true for Nix.