Docker Community Forums

Share and learn in the Docker community.

Linux distro compatibility between host and container

(Janosi) #1

Dear All,

I would like to ask, what is the compatibility requirement between host “bootfs” and base image in the container?
For example, can we use Debian base image on top of RHEL host?
And if considering the same distro (RHEL base image on RHEL host), do we know the version compatibility requirements? (e.g. RHEL7 host vs RHEL6 base image)

Thank you!

Best regards,

(Sven Dowideit) #2

Yes, you can use any distro base image in a container on top of any booting Linux that runs Docker

A huge example of this is Boot2Docker - a minimal linux (22MB), on which you can run containers that are based on RHEL (if you have access), Debian, busybox,or the hyper-minimal asm based images like hello-world or tianon/true

The only thing shared is the kernel.

(Janosi) #3

Thank you!
Best regards,

(Rashmin87) #4

I have a question along the same lines. If my applications are kernel dependent and they all work on separate version of kernel, I believe I can’t run them in container over a host having single kernel, right?

(Sven Dowideit) #5

correct, Docker containers run using the host’s kernel.

you can however make an orchestration container which then selects, pulls and runs the right tagged image, after detecting the kernel options on the host.

or, you could get the container to auto-build for the current kernel (with some more code)

@rashmin87 if you have more detailed questions, its worth opening a new forum post, so its more findable :slight_smile:

(Rashmin87) #6

Thanks for the quick response. That was helpful.