HiveBrain v1.2.0
Get Started
← Back to all entries
patterndockerMinor

Porting a docker container to a different Linux host OS

Submitted by: @import:stackexchange-devops··
0
Viewed 0 times
portingcontainerdockerdifferenthostlinux

Problem

I'm new to Docker. I have looked at many tutorials, however, this is still not clear to me :

For example, If I create a docker image on a system which is using Ubuntu as the host OS. Can I then later port and use this same docker image on a different computer using a different flavour of Linux for the host OS, for example CentOS or any other?

Solution

Yes, as long as you have the Docker daemon running on the CentOS. Docker heavily utilizes a set of kernel features - namespaces and cgroups. That set comes native for all Linux derivatives.

In terms of 'porting' the image, you have 2 widely used options:

-
docker save on your Ubuntu host. Get the saved archive to your CentOS and load the image with docker load

-
The above option is not so convenient for the standard CI/CD stack, so you might just push your image from your Ubuntu host to a so called registry. Once the image is in your registry, you could pull it from your CentOS host.

Context

StackExchange DevOps Q#11714, answer score: 3

Revisions (0)

No revisions yet.