4

Are docker images portable across different linux flavours? Let's say, if I have OEL based docker image with database installed in it, can I run this in boot2docker on a Mac?

MK4444
  • 41
  • 5

1 Answers1

4

Yes, you can archive an image (docker save/docker load), copy it on your mac unless your image and run a container in a boot2docker Tiny Core VM.

The only case where an image might not be portable is if its OS filesystem depends on certain patch level of the kernel.
In that case, a container from that image would only run on the right kernel.

hek2mgl mentions in the comments that a feature like inotify works only on Linux (should work on the TinyCore VM of boot2docker), but would not work when sharing a folder from the (non-Linux) host (ticket VBox 10660 or boot2docker PR 284 comment).

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • 2
    Use docker save and load, not export and import, or you will lose the metadata. – Adrian Mouat May 01 '15 at 18:42
  • @AdrianMouat Good point. I have updated the answer accordingly. – VonC May 01 '15 at 18:45
  • If the application inside docker is using Linux features it will not run on a Mac. For example an application that utilizes `inotify` will work on Linux only. – hek2mgl May 01 '15 at 18:56
  • 1
    @hek2mgl but on Mac, it would run in a Linux Tiny Core VM, no? That Linux is configure to support inotify (https://github.com/boot2docker/boot2docker/blob/a142bc9a50e443f9a1fe32a004c2d3bff24fab52/kernel_config#L3800) – VonC May 01 '15 at 19:06
  • 1
    @hek2mgl I get it: it does not work when sharing a folder from the (non-Linux) host. I have edited the answer accordingly. – VonC May 01 '15 at 19:15
  • Looks my comment was just stupid - having that `boot2docker` thing. Inotify might possibly even work with shared folders, it can, but I don't know how shared folders are implemented actually. – hek2mgl May 01 '15 at 19:28
  • 1
    @hek2mgl no, I think you were right: it doesn't appear to work with shared folder from an non-Linux host. – VonC May 01 '15 at 19:28