Linux - ContainersThis forum is for the discussion of all topics relating to Linux containers. Docker, LXC, LXD, runC, containerd, CoreOS, Kubernetes, Mesos, rkt, and all other Linux container platforms are welcome.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I am a newbie to Linux and a newbie to working with servers. I have been given two Dell PowerEdge R620 servers to play with, and I would like to set one up with Linux. This whole exercise is meant to learn a set of IT skills and get some experience under my belt when I want to start looking for jobs in 2 years’ time.
I have been advised to give containers a try as it is generating a lot of momentum.
Ideally I would like to setup a main server with a Container supported OS like Ubuntu Core or Container Linux, running multiple Linux Server Distro’s in their own container. Starting with the easy options, and work my way up.
I think I understand that I need some kind of a container (template)/image for the specific OS I want to run when creating the container, https://us.images.linuxcontainers.org. This I believe to be a list of non-official container images.
When I start googling for official containers or for containers not on the list, it gets all a bit confusing, as a lot of distros support containers, but don’t tell if they can be containerized. I also often end up at Docker, which is also a bit unclear, if this is a Docker package supported by the Linux Distro, or a Linux Distro that runs inside a Docker container.
My main questions are:
-Can any Linux Distro run inside a container?
- Are containers for Docker, Ubuntu, CentOS, Container Linux all interchangeable?
- Is there a list of official container images/(templates) of Linux server distros?
I would say yes, but it has to be prepared for this. The images you find on https://us.images.linuxcontainers.org/ are examples for containerized distros running on the Linux Containers platform, also known as LXC and LXD.
Quote:
- Are containers for Docker, Ubuntu, CentOS, Container Linux all interchangeable?
Here your confusion shows.
Docker is a platform for running containers plus a huge container repository. Centos and Ubuntu are operating systems, and Container Linux (formerly known as CoreOS) is an operating system that containerizes all services using Docker or another its own container technology rkt.
You are not comparing apples with oranges, but apples with broccoli and spaghetti.
Like Docker, LXC/LXD is a container platform, although they have different purposes. The purpose of a Docker container is to package an application so that it can run everywhere. A little bit like the Java promise in the 1990s. LXC/LXD is more focused on containerizing full operating systems. No,
Docker containers and LXC/LXD containers are not interchangeable.
The third Linux container platform I am aware of is OpenVZ, also available as a commercial product named Virtuozzo. Like LXC/LXD, its purpose is light-weight virtualization of entire operating systems. It's the pioneer in this technology but seems to be less known than the two others.
Quote:
- Is there a list of official container images/(templates) of Linux server distros?
I don't think there is anything like official container images. The list you found is for LXC/LXD, and Docker has its own list.
Last edited by berndbausch; 10-03-2019 at 01:36 AM.
I would say yes, but it has to be prepared for this. The images you find on https://us.images.linuxcontainers.org/ are examples for containerized distros running on the Linux Containers platform, also known as LXC and LXD.
The LXC/LXD format is a "general" Linux Container Format? This is supported by a couple of Linux Distro's, but not by Container OS?
Quote:
Here your confusion shows.
Docker is a platform for running containers plus a huge container repository. Centos and Ubuntu are operating systems, and Container Linux (formerly known as CoreOS) is an operating system that containerizes all services using Docker or another its own container technology rkt.
I understand that Centos, Ubuntu and Container Linux are operating systems, my confusion arise when googling for containers with these operating systems. The results are always pointing toward the container support by these and other operating systems and I can't find out if the specific OS can also be containerized.
Quote:
Like Docker, LXC/LXD is a container platform, although they have different purposes. The purpose of a Docker container is to package an application so that it can run everywhere. A little bit like the Java promise in the 1990s. LXC/LXD is more focused on containerizing full operating systems. No,
Docker containers and LXC/LXD containers are not interchangeable.
Is docker an Container OS by itself or does it need to run within an operating system? So for my purpose where I like to try different flavours of operating systems, docker would not be the best choice.
Quote:
I don't think there is anything like official container images. The list you found is for LXC/LXD, and Docker has its own list.
My intentions are to use a container supported OS (Linux) and run multiple Linux server OS inside containers. I think this will be easier to deal with when I screw things up or wanting to try something new instead of reinstalling the server.
The Dell server officially supported drivers are for Red Hat. Is using CentOS as my container OS going to increase my chances of driver support for non supported operating systems, or is it not going to matter?
The LXC/LXD format is a "general" Linux Container Format? This is supported by a couple of Linux Distro's, but not by Container OS?
I don't know what you mean by "general". The Container Linux web site says:
Quote:
The container engines Docker and rkt are configured out of the box, ready to run your applications.
Perhaps it's possible to configure LXC/LXD instead. You need to read their documentation to confirm this.
Quote:
I understand that Centos, Ubuntu and Container Linux are operating systems, my confusion arise when googling for containers with these operating systems. The results are always pointing toward the container support by these and other operating systems and I can't find out if the specific OS can also be containerized.
Any Linux distro can be containerized. If you want to containerize it yourself, however, you will have to invest some work.
Quote:
Is docker an Container OS by itself or does it need to run within an operating system?
Docker runs on an operating system.
Quote:
So for my purpose where I like to try different flavours of operating systems, docker would not be the best choice.
Any container framework needs to run on top of an OS. Keep in mind that containerized software shares the kernel and many other resources like the filesystem with the host system. This requires a host system in the first place. If your containerized OS is Linux-based, you need to run a Linux-based host system.
My intentions are to use a container supported OS (Linux) and run multiple Linux server OS inside containers.
You can use Docker or other container systems to try different flavours of OSs. You should be aware, however, that the look and feel of a containerized OS is not the same as a non-containerized OS.
Quote:
I think this will be easier to deal with when I screw things up or wanting to try something new instead of reinstalling the server.
My recommendation is to use a virtual machine or a live DVD instead. You will have the full operating system, not the containerized version. In the case of a VM, the separation of host OS and guest OS will be close to perfect, which is not the case with containers. And a live DVD can even be used on a system that has no software installed at all, even a diskless system. It's slower, though.
Quote:
The Dell server officially supported drivers are for Red Hat. Is using CentOS as my container OS going to increase my chances of driver support for non supported operating systems, or is it not going to matter?
Short answer: It matters a lot. The containerized OS uses the same kernel as the underlying CentOS. Therefore, it uses the same kernel drivers. EDIT: Same remark as the EDIT above.
I don't know what you mean by "general". The Container Linux web site says:
I probably don’t know either. I was thinking along the lines that a lot of Linux Operating Systems support LXC/LXD out of the box, and that it would need additional software to support Rocket or Docker.
Quote:
Any Linux distro can be containerized. If you want to containerize it yourself, however, you will have to invest some work.
Is that due to the difference between running an application inside a container or an Operating System?
Quote:
Any container framework needs to run on top of an OS. Keep in mind that containerized software shares the kernel and many other resources like the filesystem with the host system. This requires a host system in the first place.
Some container frameworks are integrated within the OS? Or am I missing something?
I came across this as well, but I’ll just stick to the same-same, as I find this complicated enough already.
Quote:
You can use Docker or other container systems to try different flavours of OSs. You should be aware, however, that the look and feel of a containerized OS is not the same as a non-containerized OS.
Is this limited by what the Host OS can support?
Quote:
My recommendation is to use a virtual machine or a live DVD instead. You will have the full operating system, not the containerized version. In the case of a VM, the separation of host OS and guest OS will be close to perfect, which is not the case with containers. And a live DVD can even be used on a system that has no software installed at all, even a diskless system. It's slower, though.
That would be a good and probably easier alternative. I thought that using containers was kind of a simpler answer to using Virtual Machines.
The technology used to implement containers has been part of the Linux kernel for years (cgroups, namespaces, various filesystem types, ...), but implementing containerized applications using this technology is like writing a web application in assembler. You need additional software, LXC, Docker or other solutions to make this a realistic endeavour.
LXC/LXD doesn't come out of the box. You will have to install it. On Ubuntu it's fairly easy, since Canonical (the company behind Ubuntu) sponsors LXC/LXD. On RHEL-like systems, it is easy to install an old version of LXC; not easy to install anything recent or LXD (I am talking from experience with Centos 7.x, where x is a comparatively small number. Perhaps the situation is better for higher values of x, and for Centos 8).
Docker on the other hand is fairly easy to install. Docker (the company) has an obvious interest in making it simple.
A containerized OS is different from a non-containerized one in may ways. For example, anything that modifies the kernel is forbidden or at least limited, since it affects the container host. Also, run ps -ef in a container and admire a list of three or four processes compared to the tens or hundreds of processes on a normal OS. This is why I think that you should not use containers to evaluate whether an operating system is good for you.
In my opinion, it is considerably easier to use a virtual machine solution like Virtualbox or KVM and perform a full OS installation on it, rather than trying to get a meaningful OS up in a container. For one thing, a VM allows you to experience OS installation from an ISO file. A container doesn't. The only downside of VMs is that they consume a lot more resources than containers. On your PC, you may be able to run three VMs in parallel, but hundred containers. However, this should not be an obstacle for your use case.
The technology used to implement containers has been part of the Linux kernel for years (cgroups, namespaces, various filesystem types, ...), but implementing containerized applications using this technology is like writing a web application in assembler. You need additional software, LXC, Docker or other solutions to make this a realistic endeavour.
LXC/LXD doesn't come out of the box. You will have to install it. On Ubuntu it's fairly easy, since Canonical (the company behind Ubuntu) sponsors LXC/LXD. On RHEL-like systems, it is easy to install an old version of LXC; not easy to install anything recent or LXD (I am talking from experience with Centos 7.x, where x is a comparatively small number. Perhaps the situation is better for higher values of x, and for Centos 8).
Docker on the other hand is fairly easy to install. Docker (the company) has an obvious interest in making it simple.
A containerized OS is different from a non-containerized one in may ways. For example, anything that modifies the kernel is forbidden or at least limited, since it affects the container host. Also, run ps -ef in a container and admire a list of three or four processes compared to the tens or hundreds of processes on a normal OS. This is why I think that you should not use containers to evaluate whether an operating system is good for you.
In my opinion, it is considerably easier to use a virtual machine solution like Virtualbox or KVM and perform a full OS installation on it, rather than trying to get a meaningful OS up in a container. For one thing, a VM allows you to experience OS installation from an ISO file. A container doesn't. The only downside of VMs is that they consume a lot more resources than containers. On your PC, you may be able to run three VMs in parallel, but hundred containers. However, this should not be an obstacle for your use case.
Sorry for the pointless quote here. I don't think this works; @berndbausch
Just wanna say thanks. It is slowly starting to make sense, and I am starting to understand the basic differences and limitations.
I would recommend against it. Rancher 1 has been a disaster (horrible upgrade process - random uncontrollable stuff; horrid iptables management that forces you to expose your system if you don't use a separate firewall - official dev suggesting filtering in the mangle table! (https://forums.rancher.com/t/how-to-...tables/249/6); to name just a few). Don't know why you'd trust Rancher 2 (with Kubernetes).
It's not a bad idea to have a layer of abstraction for a system as difficult as Kubernetes, but I'd first try to understand what's happening under the hood before becoming dependent on a platform that looks nice.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.