<p>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.</p>

<p>In terms of 'porting' the image, you have 2 widely used options:</p>

<ol>
<li><p><a href="https://docs.docker.com/engine/reference/commandline/save/" rel="nofollow noreferrer">docker save</a> on your Ubuntu host. Get the saved archive to your CentOS and load the image with <a href="https://docs.docker.com/engine/reference/commandline/load/" rel="nofollow noreferrer">docker load</a></p></li>
<li><p>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.</p></li>
</ol>

CC BY-SA 4.0
2020-05-28T16:31:20.187Z
Thanks for your reply. I guess it gets more complicated porting an image from a Linux host to a Windows host and vice-versa?
Engineer999
CC BY-SA 4.0
2020-05-29T07:05:27.837Z
You can run Linux containers using Docker desktop on windows out of the box. See https://docs.docker.com/docker-for-windows/
M_dk
CC BY-SA 4.0
2020-05-29T07:43:49.283Z
Note that you can run your Linux-based containers on Windows, because of _stuff that goes on in the background seamlessly, sort of_, but you can't run Windows-based containers on Linux. I say _sort of_ seamlessly, because you need to start the docker daemon with a special flag, but other than that it's the same. Also, for Windows, you could look into running docker on the Windows Subsystem for Linux: 
 https://docs.docker.com/docker-for-windows/wsl/
Andrei Mustață
CC BY-SA 4.0
2020-05-28T16:20:53.283Z
2020-05-28T16:23:51.860Z
2020-05-28T16:23:51.860Z
Recoba20
<p>I'm new to Docker. I have looked at many tutorials, however, this is still not clear to me :</p>

<p>For example, If I create a docker image on a system which is using Ubuntu as the <strong>host</strong> 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? </p>

<docker><containers><linux><centos><ubuntu>
Porting a docker container to a different Linux host OS
Engineer999
# Porting a docker container to a different Linux host OS

(Asked by: username_0 on 2020-05-28)

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?

**Tags:** docker, containers, linux, centos, ubuntu


---

## 1 answers

### Answer by username_1 on 2020-05-28. Score: 3

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:

1. [docker save](https://docs.docker.com/engine/reference/commandline/save/) on your Ubuntu host. Get the saved archive to your CentOS and load the image with [docker load](https://docs.docker.com/engine/reference/commandline/load/)
2. 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.

> **Comments:**
> **username_0**: Thanks for your reply. I guess it gets more complicated porting an image from a Linux host to a Windows host and vice-versa?  
> **username_2**: You can run Linux containers using Docker desktop on windows out of the box. See https://docs.docker.com/docker-for-windows/  
> **username_3**: Note that you can run your Linux-based containers on Windows, because of _stuff that goes on in the background seamlessly, sort of_, but you can't run Windows-based containers on Linux. I say _sort of_ seamlessly, because you need to start the docker daemon with a special flag, but other than that it's the same. Also, for Windows, you could look into running docker on the Windows Subsystem for Linux:   https://docs.docker.com/docker-for-windows/wsl/  

---

