Search code examples
linuxdockerkernelcontainersversion

How much a Docker container is portable?


I was searching through the Internet to find the answer for this question: How much a Docker container is portable?

I am aware of OCI which is a way of standardization that Docker has founded, and I am also aware that you can't simply move Linux containers to Microsoft Windows platform and vice versa. My specific question is, can I restart my container on a different host with different kernel version? Or with different Docker version?

Use Case: I am looking into a platform that helps for live migration of state-full containers, to manage workloads, reduce downtime and increase high availability. To what extent such a system is limited to the underlying systems such as Linux kernel version, docker version, etc. Thank You


Solution

  • In the major of the situations, Docker containers run on different host should run in the same way, disregarding of the Kernel version.. as long as the Kernel meets the minumum requirements.

    Docker does not change what are the requirements of the software run inside a Docker container. What does that mean is.. if the software inside would have problems on an old Kernel, running it on Docker.. on an old kernel will probably have problems as well. (check the answers on this question, they explain a lot: How does Docker handle different kernel versions?)

    Regarding Docker version, there's a page on Docker docs explaining Breaking changes which you can find here: https://docs.docker.com/engine/breaking_changes/

    A Docker image does not specify the Docker version it was built with.. if there are no breaking changes between the version used to build and push and the other one trying to pull and run the image, it should work.

    Also, if you are searching for a platform which uses Docker and provide high-availability and stateful containerized applications.. there are many options, I suggest you to take a look at Kubernetes (https://kubernetes.io/docs/concepts/overview/what-is-kubernetes/)

    Usually, such high-availability platforms are composed of many standardized nodes (same Kernel, same lib and Docker versions, same amount of RAM and CPUs available and so on) in order to distribute containerized applications in an uniform way across the nodes.. and also to provide easy mainteinability (maybe using Ansible and similar tools)