Re:A lesson in dockerizing shell scripts
by c0l0 on Saturday February 03, 2024 @10:28AM
(#39241196)
For me, insane sh*t like this proves that those who do not learn from distribution and package management infrastructure engineering history are condemned to reinvent it, poorly.
[ Parent
| on HN ]
Re:A lesson in dockerizing shell scripts
by bhupesh on Saturday February 03, 2024 @10:33AM
(#39241257)
Hey author here.
I understand that you might have some context about package managers that I am missing. Would genuinely like some resources about your comment or maybe a bit of explanation.
Thanks
Hey there Bhupesh - apologies for the snark! I was just venting some of the frustration I feel every day with modern "devops" tooling ;)
I am in a bit of a rush right now (which is why I try my absolute best to keep procrastinating on HN at the the absolute minimum, I swear! ;)), but I will try to share some insight later (potentially as a comment on your blog).
Re:A lesson in dockerizing shell scripts
by codethief on Saturday February 03, 2024 @11:27AM
(#39241836)
I'd be interested in this, too, so I'd be grateful if you could notify us here, wherever you end up posting your comment!
Re:A lesson in dockerizing shell scripts
by bhupesh on Saturday February 03, 2024 @10:42AM
(#39241361)
Thanks, appreciate the help!
Re:A lesson in dockerizing shell scripts
by tiziano88 on Saturday February 03, 2024 @11:38AM
(#39241946)
It may be worth looking at Nix if you haven't already
Re:A lesson in dockerizing shell scripts
by gbN025tt2Z1E2E4 on Saturday February 03, 2024 @02:21PM
(#39243780)
I explained a bit here in my reply to your other comment:
Re:A lesson in dockerizing shell scripts
by crabique on Saturday February 03, 2024 @09:00PM
(#39246798)
At this point, why not just build statically linked binaries of those utils in the build stage and just copy them over? Or even better, have a static build of busybox with all of the non-dependencies disabled. Those filename bytes add up fast!
On unrelated note, --chmod parameter of the COPY instruction provides a way to avoid additional layers just to set the executable bits:
# instead of
COPY ugit .
RUN chmod +x ugit && mv ugit /usr/local/bin/
COPY --from=builder /usr/local/bin/ugit /usr/bin/
# could just be this
COPY ugit --chmod=755 /usr/bin/
In all seriousness though, that Dockerfile is basically one big uglified red flag, please don't do this, people.