简体   繁体   中英

Build Docker image on different host OS

Can the underline Linux distribution and/or version differ for the following jobs:

build a docker image (eg build a CentOS docker image in an Ubuntu host, or build a CentOS 6.6 docker image in a CentOS 7.1 host) run a docker container (eg run a CentOS docker container in an Fedora host, or run a CentOS 6.6 docker container in a CentOS 7.1 host)

The same question applies to the Docker engine version, eg, can I build the docker image in a host installed with Docker 1.9 but run it in a host installed with Docker 1.12?

And yet deeper how about different versions of Linux kernels, eg, build under kernel 3 but run under kernel 4?

I guess I understand Docker really is just the chroot environment on steroid, so underline OS when containers are built and run really should not matter, but I see people have run into issues with incompatible OS/versions, anyone can provide some insights on this subject?

Building one distribution on another is not a problem (eg building a CentOS container on an Ubuntu system, etc.)

Regarding Docker versions, there are situations where you may not be able to run a container built with a newer Docker, using an older Docker engine. If you build an image and then run it on a newer Docker engine, it should not be a problem. This is because newer Docker engines may build an image that has features the older engine does not understand. But it shouldn't be a problem the other way.

The kernel version should not be a huge deal, but it depends on the software you're using. If the software expects to run on kernel 4, and you run it on kernel 3, then it may not work. But that is only a problem when there are kernel features required that are not present in the older kernel version. That is not all that common, at least with typical software. But it certainly could happen.

This advice is pretty generic, I'm afraid, since this is a general question, not about specific software versions or packages.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM