Vishwa: “Let say the host OS is RHEL. Then guest image should not contain other than RHEL. Docker doesn’t support mounting of different OS. Also, I cannot launch multiple OS containers from a single OS image.” Am I right?
Larrycai: I assume the host OS means docker host OS, then
No, you can run Ubuntu docker image in RHEL Docker host or another other docker host.
They just share the linux kernel. the OS depends on libc and other libraries. (search stackoverflow)
Vishwa: So, the host and guests must be of any Linux OS versions(Ubuntu, RHEL, CentOS, Fedora etc) but it is not possible to have Windows Docker on Linux host and reversal. Right?
Vishwa:“Let say, I have an application image and this image doesn’t contain any stuff related to guest OS. i.e. this image is a purely application image and after deploying this image- A container is created and inside the container application will be started.” Correct?
Larrycai: Yes, it is possible, see docker run hello-world, it is just 910 bytes as pure application
*Vishwa:*In the above two questions, I am separating the application image and OS image.
“As Docker is light weight and sharing the OS kernel, no guest OS is needed to run an application in a new container created.” Correct?
Larrycai: Yes and No
Yes, no guest OS is needed for simple application like hello-world or other busybox ( in Dockerfile, use FROM scratch)
No, mostly application will still have guest OS for easy dependence handling (in Dockerfile, use FROM Ubuntu)
Vishwa: In case, I want to run an application on Ubuntu container in RHEL host then the Docker image should contain Ubuntu OS and the actual application. Then the size of the Docker images will be more than 1 GB. Then how Docker is light weight then?