Is a Docker/LXC container a running app or something in-memory?

后端 未结 1 471
Happy的楠姐
Happy的楠姐 2021-01-03 03:43

I just read the excellent SO question asking \"What is the difference between Docker and a VM?\". However, the accepted answer left me wanting just a wee bit more.

I

1条回答
  •  Happy的楠姐
    2021-01-03 03:55

    the answer still doesn't explain exactly what a "container" is!

    A container is basically a process, isolated, with all the environment it needs for its job (a webserver, a database, a CMS, any software...).

    A container uses Linux kernel namespaces to isolate process, network and filesystems. A container uses the concept of process isolation: filesystem, process, network, resource (CPU, memory),logging (STDIN...), shell isolation.

    Docker/LXC - I don't get the difference

    LXC is a set of tools to control containers; Docker is another set of tools (all bundled into the same program), that also adds a file format so the contents of an 'image' can be passed around from machine to machine. Docker is vastly more talked-about than LXC. Docker used to use the lxc library to control containers, but replaced it with its own library called...libcontainer.

    What are the exact computing/system resources multiple containers can share inside the same VM/physical?

    Containers on the same machine will share CPU, memory and the kernel. Additionally, Docker lets you optionally have them share the same network.

    Is Docker/LXC the "hypervisor" in the container equation?

    The Linux kernel is the real "hypervisor", and Docker/LXC are sending it commands to create and control containers.

    0 讨论(0)
提交回复
热议问题