Comment on What is Docker?
Black616Angel@discuss.tchncs.de 1 day ago
Please don’t call yourself stupid. The common internet slang for that is ELI5 or “explain [it] like I’m 5 [years old]”.
I’ll also try to explain it:
Docker is a way to run a program on your machine, but in a way that the developer of the program can control.
It’s called containerization and the developer can make a package (or container) with an operating system and all the software they need and ship that directly to you.
You then need the software docker (or podman, etc.) to run this container.
Another advantage of containerization is that all changes stay inside the container except for directories you explicitly want to add to the container (called volumes).
This way the software can’t destroy your system and you can’t accidentally destroy the software inside the container.
entwine413@lemm.ee 1 day ago
It’s basically like a tiny virtual machine running locally.
folekaule@lemmy.world 1 day ago
I know it’s ELI5, but this is a common misconception and will lead you astray. They do not have the same level of isolation, and they have very different purposes.
For example, containers are disposable cattle. You don’t backup containers. You backup volumes and configuration, but not containers.
Containers share the kernel with the host, so your container needs to be compatible with the host (though most dependencies are packaged with images).
For self hosting maybe the difference doesn’t matter much, but there is a difference.
fishpen0@lemmy.world 1 day ago
A million times this. A major difference between the way most vms are run and most containers are run is:
VMs write to their own internal disk, containers should be immutable and not be able to write to their internal filesystem
You can have 100 identical containers running and if you are using your filesystem correctly only one copy of that container image is on your hard drive. You have have two nearly identical containers running and then only a small amount of the second container image (another layer) is wasting disk space
Similarly containers and VMs use memory and cpu allocations differently and they run with extremely different security and networking scopes, but that requires even more explanation and is less relevant to self hosting unless you are trying to learn this to eventually get a job in it.
chunkystyles@sopuli.xyz 21 hours ago
This doesn’t jive with my understanding. Containers cannot write to the image. The image is immutable. However, a running container can write to its filesystem, but those changes are ephemeral, and will disappear if the container stops.