Docker Community Forums

Share and learn in the Docker community.

Compatibility: Using Docker images on different Docker versions

(Ruebe) #1

Hi there,

I need to support different Linux distributions (as of Ubuntu 12.04.1, CentOS 6, …) ideally with the same Docker image. My understanding is that, up to and including Docker 1.9, the image format was portable, but that a new image format was introduced with Docker 1.10 . I understand that new Docker versions will implicitly convert old image formats.

However, what happens when sending a new Docker image to an older Docker version, e.g. on Ubuntu 12.04.1 ? I guess that Docker itself will not necessarily be updated on older system repositories ? Is there a “backwards-compatible” flag on Docker, so that I can always work with the old image version for the time being ?

Thanks and Best Regards,

(Jeff Anderson) #2

The image format change for 1.10 only dealt with the local image storage. Push and pull are still intended to work the same (even pushing with a 1.10 engine and pulling with 1.9)

(Ruebe) #3

Hi there,

sorry if I do not understand completely: Has the format of the image files themselves changed, or the format of the local image store ?

Essentially we build custom Docker images based on one of the standard base images (such as a minimal Ubuntu image). The main goal is the minimization of dependencies on the host OS.

The images will likely not be uploaded to the global image store used by the Docker community, but may be stored inside of our own Docker store (or possibly a commercial store such as the one provided by Sonatype Nexus). It would be great if the same image would work e.g. both on Ubuntu 14.04 and 16.04, without a need for local changes.

In any case thanks and Best Regards,

(Jeff Anderson) #4

In 1.10, the local storage changed to reflect the digest of the content stored in the layer.

The layers themselves are still the same layers. You can still push an image with 1.10, and pull it with 1.9.

Both ubuntu 14.04 and ubuntu 16.04 can run docker 1.10, so I’m not sure how to address your concern on that front.

(Ruebe) #5

Thanks a lot – this helps!
Kind Regards,

(Tropicalcanine) #6

I’ve been following this answer. It does not matter to me the version of the host OS, but rather the docker version installed on it. What if images are built with 1.10 and run on 1.9 or worse 1.8? For example, RHEL is very slow in supporting the latest versions of docker. Of course the API to docker has changed and newer command line flags will not work on older docker command lines. But will the images run the same?

(Qbadx) #7

Hi All,

I have been developping images on my ubuntu 14.04 using docker 1.10 and now I 'm trying to run them on a Centos 6.6 server running docker 1.7 .

when I try to run my image

docker run -itP -name blabla -h blabla.mydom myrepo:myimage /bin/bash

I get this error:

Exec: “/bin/bash” stat /bin/bash: No such file or directory

I can do any command instead of /bin/bash I always receive the same error.

Do you think it is related to versions mismatch ?

(Jeff Anderson) #8

It sounds like you just don’t have /bin/bash in your image. That would have nothing to do with the image format changes in 1.10-- basically the only change is that it hashes the image content now. It doesn’t change what’s in your images.

(Qbadx) #9

Hi Jeff, thx for the reply.
I do have /bin/bash in my image, no doubt about that, it is an ELK image I built myself and I have been working with it the past month on my ubuntu.
If I replace bin/bash by “/bin/echo hello” I have the same issue : /

I’m puzzled