I'm curious about why Docker images are generally much lighter than the typical local installations of software like MySQL. For instance, if we look at the MySQL Docker image, it seems different from installing MySQL on Windows 10. Both are using Windows OS resources and making Windows API calls, so why does the Docker image take up less space? What makes the regular installation bulkier with more files?
3 Answers
It's worth mentioning that there isn't a specific 'Docker for Windows' since it runs on a Linux VM. This means you’re mainly dealing with Linux containers. While there are Windows containers, they’re typically not as common or lightweight as Linux-based ones. The design of Docker is fundamentally tailored for Linux, which contributes to the efficiency and smaller size of its images.
Docker images are primarily built on Linux, which is inherently smaller and more efficient compared to Windows-based installations. When you look at a traditional MySQL installation on Windows, it includes a lot of additional components like GUI software and various DLLs that bulk it up. In comparison, the Docker image focuses on just the necessary components for MySQL, cutting out everything extra, which is why it ends up being much lighter. It's really more of a matter of comparing Linux installations rather than Windows to Docker directly.
Docker container images are compact because they only include what's necessary to run the application. Unlike virtual machines, they don't carry a full operating system. If you're running Linux containers on Windows, it does add some overhead for the virtual Linux layer, but overall, the containers are leaner since they utilize shared resources from the host OS.
Related Questions
How To: Running Codex CLI on Windows with Azure OpenAI
Set Wordpress Featured Image Using Javascript
How To Fix PHP Random Being The Same
Why no WebP Support with Wordpress
Replace Wordpress Cron With Linux Cron
Customize Yoast Canonical URL Programmatically