BARATH
BARATH

Reputation: 372

Docker with different Container OS and Host OS

I am aware that Docker containers shares the host OS, id it possible to run two different container environments on a single host OS/machine?

Upvotes: 3

Views: 1593

Answers (1)

TJ Zimmerman
TJ Zimmerman

Reputation: 3484

Yes this is possible. In fact, some enterprise solutions actually take advantage of this solution. Rancher, for example, creates a platform for deploying Kubernetes environments. The underlying operating systems for the nodes are typically deployed as their own OS, RancherOS. Wherein there are two instances of the Docker daemon running. One for userland, and one for system apps. RancherOS is unique in that is runs all essential system services as containers on the host. So when you connect to a node, you can run a system-docker ps and see the state of all the services. However, if you run a docker ps you will only see your userland containers.

Here is more information on this solution: https://rancher.com/docs/os/v1.2/en/system-services/adding-system-services/

As for doing so yourself, this is also possible and somewhat simple. Here is an example of someone doing so: https://www.jujens.eu/posts/en/2018/Feb/25/multiple-docker/

Alternatively, if you didn't want to modify your personal workstation, you can also run docker within a docker container using a project like this: https://github.com/jpetazzo/dind

Let me know if I can help you with anything else. :)

Upvotes: 2

Related Questions