Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 1 Jun 2016 11:54:42 -0400
From:      Kurt Lidl <lidl@pix.net>
To:        freebsd-virtualization@freebsd.org
Subject:   Re: Running FreeBSD docker images on non-FreeBSD hosts
Message-ID:  <d1475a4a-97f9-ae4e-7ddb-4716e3f58427@pix.net>
In-Reply-To: <CA%2BMCM4v308E8iOzP9TCo57PO2ZqriD%2BevYh9nt6XWvLP%2BWmAUA@mail.gmail.com>
References:  <CA%2BMCM4v308E8iOzP9TCo57PO2ZqriD%2BevYh9nt6XWvLP%2BWmAUA@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
> I'm acquainted with docker, but I don't know enough to understand
> why an image would run in a container on one OS but not in a
> container on another OS. I thought the whole point of docker was
> that, assuming the image worked at all, it worked regardless of which
> host you used. So that's an incidental question I have: what's going
> on here? Is it something particular to FreeBSD's implementation of
> docker?

Docker provides a "container" for running a particular application.
It's similar to a FreeBSD jail, in that the running process(es) in the
container cannot interact with the rest of the system, except at the
system call level, and where the host running docker has mapped any
files into the docker filesystem namespace.

What isn't really explained in so many words -- the container uses the
system calls from the hosting computer to evaluate anything that it
needs the "kernel" to do. So your "FreeBSD docker" image, when run on
a Linux machine, is attempting to make FreeBSD system calls into the
Linux kernel.

> But my main question is, what can I do to run a FreeBSD image on a
> non-FreeBSD host? I'm willing to [figure out how to] build my own
> image if necessary. I just don't want to go to the trouble if it's
> a non-starter for some reason I don't understand.

You'd have to use some other solution to provide a "FreeBSD system call 
interface" to your FreeBSD docker image.

The recent import of Linux 64bit emulation in FreeBSD allows for running
stock "docker" images on FreeBSD, because there's now a shim that
translates Linux system calls to FreeBSD ones.

On the Mac, they have shims that provide filesystem access to the Mac's 
filesystems, and a virtualized machine using the xhyve stuff, providing
the Linux system call interface.

Make no mistake about, docker is Linux inside.

If you want to run FreeBSD inside a virtual machine, try the xhyve stuff
on the Mac, or under KVM on Linux.

-Kurt



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?d1475a4a-97f9-ae4e-7ddb-4716e3f58427>