Vladimir Supalov writes about Docker, deployment, Django, and developer workflows, plus small projects such as an HN title analysis.
HN commenters link his posts on running databases in Docker and BuildKit cache mounts as answers to practical Docker questions.
Understood, sorry about that.
But that's how it feels to me.
It's mostly because my mental image of multistage builds is different, I see them as a way to make the final image smaller by throwing away everything from the previous image.
So it does make sense to me that ARG values are thrown away after a new FROM instruction and if you need them, you need to declare them again.
These two guides have led me to this view, I blame the author! ;) They're excellent BTW, I've revisited them a lot.
https://vsupalov.com/docker-arg-env-variable-guide/#arg-and-env
https://vsupalov.com/build-docker-image-clone-private-repo-ssh-key/
It makes sense that mounting a volume requires understanding a user mapping tbh. I think the answer is twofold:
a) Many problems solvable with a volume can be solved with a bind-mount, cache-mount, etc [0].
b) In the event that you actually need to map in a user-file, wrap the docker command in a script that manages the logic. At this point you're writing a system tool that's doing things outside of the context of a container - it's not really docker's fault that it doesn't try to make this trivial.
[0] https://vsupalov.com/buildkit-cache-mount-dockerfile/
I wondered about an adjacent topic recently ("what IS the kernel actually") and found out that a great way to understand it, would be to start with the boot process. Once I felt less lost, I tried to capture my learnings [1]
The text is not edited yet, but as I had the benefit of learning about it with fresh eyes, it should be very approachable (and hopefully accurate enough)
[1] https://vsupalov.com/demystifying-kernel/
It is really not recommended to run (production) databases in Docker, unless you know what you are doing.
https://vsupalov.com/database-in-docker/
Well, I wasn’t completely crazy. There was just a subtlety I missed.
https://vsupalov.com/database-in-docker/
Oh hmm, no you can't: https://vsupalov.com/cache-docker-build-dependencies-without-volume-mounting/