5 ms·
I noticed you start to find every operating system quirk ever when you start writing Dockerfiles. I've run into so many strange things just converting a simple
by dmix 5y ago
I noticed you start to find every operating system quirk ever when you start writing Dockerfiles. I've run into so many strange things just converting a simple predictable shell script into a Dockerfile.
- _jal 5y agoWelcome to the 'ops' in devops.
- travisd 5y ago“Welcome! Sorry.”
- speed_spread 5y agoMore like DevOops
- viraptor 5y agoTbh, that's just a docker quirk. There were so many ways to do this with a more reasonable implementation and yet...
- dmix 5y agoI initially just wantetd to replicate my production env locally, then after that experience I wanted to replicate my Docker env in production so that would also be predictable.
- Too 5y agoWhy not run your existing predictable script in a single RUN command? What need to be converted? The mistake many do is seeing dockerfiles as a 1:1 mapping of a shell script with RUN prefixed on every line. It’s not, you should only split a run if you have a good reason to add a new COPY in between for layer caching reasons or switching user. With the --bind options from buildkit you can ensure the apt cache does not get layered and you can mount any big temporary files needed from host instead of copying them first.
- rmetzler 5y agoAlso each RUN, COPY, ADD, etc. creates a new layer in the image so you should put commands which are related in the same command. The example in the blog post violates this principle, which is the main reason for the unexpected size.
- fivea 5y ago> I noticed you start to find every operating system quirk ever when you start writing Dockerfiles. I've been using Dockerfiles extensively for years and I'm yet to find anything that fits the definition of a OS quirk. The quirkiest thing I've noticed in Dockerfiles is the ADD vs COPY thing. > I've run into so many strange things just converting a simple predictable shell script into a Dockerfile. What exactly are you trying to do setting up a Dockerfile that requires a full blown shell script? A Dockerfile should have little more beyond updating/installing system packages with a package manager, and copying files into the container image. First you run a build to get your artifacts ready for packaging, and afterwards you package those artifacts by running your Dockerfile.
- ghoulishboo 5y ago
- staticassertion 5y ago> I’m kind of impressed with how aggressively this comment misunderstands its parent and then beats the hell out of that misunderstanding. This is just peak irony.
- ghoulishboo2 5y ago
- staticassertion 5y agoYou learned what irony was in a literary theory class?
- TobTobXX 5y agoI don't know what qualifues a s quirk, but I sometimes had to think about stuff like "who's PID 0", "do I have the CAP_WHATEVER capability", "I need to 'reap' subprocesses?" and other stuff that 'just works' when you have a decent system with a decent init process and all the other things.