Questions on Docker

  • Hello,


    I have some questions about how docker works


    I downloaded my images and set my contents as indicated in the videos (Thx for Guides :thumbup: ), but I wanted to know how the container worked.


    • Once the container in operation all the actions that it realizes are made in memory or then on the disk where is stored the container ? (the system disk)


    • When I make a docker commit to save a new image with all the settings, where can I physically find this one ?

    I looked in the way by default docker but I can not find anything that could look like the image I just made.
    I looked in what seems to me the default path: /var/lib/docker but I can not find my image.
    I also saw that it was possible to change the path by activating the plugin but I know how to enter a path that is not taken into account.


    thanking you in advance.

    AMD Ryzen 5 2400G on Asus TUF B450M-PLUS - 16Gb RAM - 3 * 3To RAID5 on LSI Megaraid SAS 9260-8i and 3 SSD in Fractal Design Node 804 Black
    OS: OMV 6.3.2-1 (Shaitan)

    • Offizieller Beitrag

    Hello,


    I have some questions about how docker works

    Dockers are mini-Virtual Machines's not unlike a workstation or server VM running in Virtualbox.


    Some of the differences are:
    - A full VM can be, and often is, as fully configured as an OS running on real hardware. A Docker, on the other hand, is designed from the start, to be bare-bones. Dockers have exactly what is needed to run the supported app., complete with all dependencies, and very little more.
    - A full VM usually requires it's own exclusive memory space, whether it uses it or not. A Docker shares memory with the host and releases memory back to the host, if not used. (And given the bare-bones nature of a docker, depending on what it is, it may use as little as a few Meg of RAM.)
    - A Docker, just like a full VM, has it's own root account and the file structure of a full Linux machine.


    - Since it's small, a Docker "container" is created almost instantly (from it's image). Similarly, a container can be destroyed and restarted in real time. Both creation and destruction happens every time your server starts up and shuts down. The only persistent files used by a Docker, are those that are mapped to a location on the Docker host in Volumes and Bind Mounts.


    - Docker uses an internal IP network (172.17.0.1/16) to isolate containers from the LOCAL HOST. Other than Volumes and Bind Mounts, and a few tools available on the CLI, one would have to intentionally break the security offered by Docker to get into and out of a container, by other means. It's pointless to do so, in any case, because the next host reboot would destroy any changes made that are not part of Volumes and Bind Mounts.

    • Once the container in operation all the actions that it realizes are made in memory or then on the disk where is stored the container ? (the system disk)


    • When I make a docker commit to save a new image with all the settings, where can I physically find this one ?

    I looked in the way by default docker but I can not find anything that could look like the image I just made.
    I looked in what seems to me the default path: /var/lib/docker but I can not find my image.
    I also saw that it was possible to change the path by activating the plugin but I know how to enter a path that is not taken into account.

    This, unfortunately, is where the train stops for simplicity. When I looked at Dockers for the first time, like you, I wanted to understand where images and containers were stored. The answer to the storage question appears to be, "all over the place".


    For example my Pi-Hole container appears to at:
    /var/lib/docker/containers/e7cb081d78637ed32f672b634687751921234a9dfbc83a5075d97b4566c99ab8
    (The later part of the above is the container ID#) However, all that is part of this container is not there.


    Since Dockers use overlays to run containers (with working, diff, merged, etc.) they don't appear to run from a single root directory structure (/ for Linux or C:\ for Windows) that most PC users are familiar with. They seem to use something that works along the lines of UnionFS, for merging directory structures, to create the working equivalent of a root directory.


    If your inquiry is about finding info for saving or backing up your Docker images or containers, the easiest way to deal with that is to backup your entire boot drive because, functionally, the boot drive is your Docker installation, images and containers.

  • Thank you very much for the explanations :) and the time you spent writing all this.
    I have as you indicated saved all of my system disk with the plugin backup and Acronis also :D

    AMD Ryzen 5 2400G on Asus TUF B450M-PLUS - 16Gb RAM - 3 * 3To RAID5 on LSI Megaraid SAS 9260-8i and 3 SSD in Fractal Design Node 804 Black
    OS: OMV 6.3.2-1 (Shaitan)

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!