Docker Community Forums

Share and learn in the Docker community.

Can we use same Image on different Docker Engine versions?

Hi Team,
I have a query, I build a docker image on 19.X Docker Engine version, And I want to use that Image on lower versions of Docker Engine (suppose: 18.X) and start the container will it work smoothly on 18.X and 19.X as well or is there any compatibility issues on 18.X ?

same vice versa, if I build a docker image on 18.X docker Engine and same image I want to test on 19.X version as well it will work on every version smoothly or is there any issue on different versions?

HI Team,
Can I hop answer.??

The oci container image specs are decoupled from the release cycles of the docker engine.There is no version compatibility binding or issue of any sort. They run with every container runtime engine, complient to oci container image specs, like Docker, Containerd, Podman, CRI-O…

Thanks for the replay Metin,
This Means I can use docker images on any docker client/server Engine Version’s right?

True for linux. Almost true for Windows containers: a windows image must exactly match to the host machines kernel. Also true with MacOS, as it will use a hypervisor to run linux containers.

Like I wrote: you don’t even need to use docker!

Thanks For that I am working on Linux OS Only.

The following command runs an ubuntu container, attaches interactively to your local command-line session, and runs /bin/bash.

$ docker run -i -t ubuntu /bin/bash
When you run this command, the following happens (assuming you are using the default registry configuration):

If you do not have the ubuntu image locally, Docker pulls it from your configured registry, as though you had run docker pull ubuntu manually.

Docker creates a new container, as though you had run a docker container create command manually.

Docker allocates a read-write filesystem to the container, as its final layer. This allows a running container to create or modify files and directories in its local filesystem.

Docker creates a network interface to connect the container to the default network, since you did not specify any networking options. This includes assigning an IP address to the container. By default, containers can connect to external networks using the host machine’s network connection.

Docker starts the container and executes /bin/bash. Because the container is running interactively and attached to your terminal (due to the -i and -t flags), you can provide input using your keyboard while the output is logged to your terminal.

When you type exit to terminate the /bin/bash command, the container stops but is not removed. You can start it again or remove it.