Search code examples
linuxdockercontainerslinux-distro

what does it mean to have just the snapshot of the distribution filesystem when creating containers in docker?


i have read that when you create a container a base operating system image must be defined and that operating system is just a snapshot of some Linux distribution file system ,i don't understand why do we need the snapshot of just the filesystem and what is its importance, is the filesystem is what separates distributions from each other ?

i know distros differ in window managers and desktop environment and that is removed in most base images except the filesystem,so is the filesystem is what essentially is different in all the distributions ?

if that is the case why do distributions have different filesystems ,and what are the diffrences between these filesystems?


Solution

  • Note that filesystem is a method of storing data. I assume that in your question by "filesystem" you mean collectively dorectires, directories structure, files, files attributes, files and directories permissions and all other data (modification times, last access times) exposed by the filesystem that the data are stored on. An operating system (for example a linux distribution) can be run on different filesystems. I run my linux on ZFS, and my servers uses ext4.

    why do we need the snapshot of just the filesystem

    To copy all the information that compose the data.

    what is its importance, is the filesystem is what separates distributions from each other ?

    Well, I would say that basically distributions primarily differ in people that take care of that distribution. Ubuntu is owned by Canonical Ltd. and Ubuntu Foundation, archlinux is produced by Aaron Griffin. Because different group of people manage the product, you get different products with different visions. It's like cars - Audi has it's own cars, Mercedes has it's own.

    distros differ in window managers and desktop environment

    No, they do not. Window manager and desktop environments are (in most cases) managed by different and separate people that manage linux distributions. You can buy Michelin tires to an Audi and to a Mercedes, the same way you can install xfce4 on archlinux and on ubuntu.

    so is the filesystem is what essentially is different in all the distributions ?

    I would say my subjective point of view would be: "management" of an linux distribution, as an overall process, as an overall community longterm vision of an operating systems goals and behaviors, but also as a process of doing daily management tasks like installing packages and bug handling would be for me what is essentially different between distributions. Archlinux wants to be simplistic, minimal, modern, user centric. Ubuntu wants to bring free software to wider audience and accelerate innovation. Different visions leads to a different product. Ferrari wants to be fast, Audi wants to be comfortable, etc.

    why do distributions have different filesystems

    Linux distributions do not have filesystems. An operating system can be installed on many filesystems: you can install ubuntu on btrfs, install ubuntu on ext4, etc.

    If by filesystem you mean all the data that is stored on a filesystem: because different distribution make different design choices when creating their operating systems, there are many differences between the data packaging process and how the data is distributed by different distributions. So the resulting data stored on a filesystem differ.

    what are the diffrences between these filesystems?

    The most visible difference to users is of course the package manager - the tool that manages and automates installing, upgrading and configuring data on your operating system. Ie. ubuntu uses apt-get, archlinux uses pacman. There are differences in distributions installations process and scripts.