3

Are there any compatibility issues or known restrictions running an Alpine-based Docker image on a Ubuntu host?

I understand that Docker provides process-level isolation and that machine resource calls are made through the cgroup interface. But I am wondering (and concerned) if there are specific cases or perhaps even languages where this type of setup (running Alpine containers on Ubuntu host) will manifest runtime issues unless you take additional steps in configuring the host machine.

Edit:
I want to try enhance my question...

I understand that Docker provides isolation but wondering if there are leaks in the isolation? If there are leaks, then perhaps its better to run a docker image on a host that matches the base image to guarantee that weird runtime errors won't happen.

To be more concrete, applications at some level require kernel code and have been built with a specific kernel. Running those applications on a host with a different kernel might open you up to weird runtime errors.

For example, would it be the case that running an x64 application in a Docker container on a x86 host lead to bad things happening?

mikehwang
  • 490
  • 3
  • 10

3 Answers3

3

As long as the host machine as Linux kernel version 3.10 or higher you should have no problems with the container.

You can see this link for more information on why: How is Docker different from a normal virtual machine?

Community
  • 1
  • 1
aemus
  • 713
  • 4
  • 14
1

It is my understanding that Docker is fully compatible among Linux distros above a certain Kernel. All Linux distros basically use the same Kernel, and that is where Docker Daemon interfaces with the system, so whatever is running inside the container should be totally fine regardless of a different distro on the host.

If the wasn't the case then Docker really wouldn't be all that useful I imagine.

I have personally run different distro containers on different host systems without any problems for the last year.

peedee
  • 3,257
  • 3
  • 24
  • 42
  • It's 2020, and we can still face unclear incompatibilities. The documentations and procedures are made by some drunk smelly lawyers. To me it's a major fail. RIP – NVRM Jul 14 '20 at 15:04
0

Problems can arise only in scenarios that break containerized system isolation on purpose, e.g. so-called docker-in-docker runs, if they expose some parts of a very different host system to the containerized apps (in which case incompatibilities in the standard C library, e.g. between Ubuntu's glibc and Alpine's musl would cause problems, as they would even between two different Ubuntu LTS versions, with differing glibc builds).

mirekphd
  • 4,799
  • 3
  • 38
  • 59