From owner-freebsd-virtualization@freebsd.org Tue May 31 22:07:00 2016 Return-Path: Delivered-To: freebsd-virtualization@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 41215B563BD for ; Tue, 31 May 2016 22:07:00 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from mx1.scaleengine.net (mx1.scaleengine.net [209.51.186.6]) by mx1.freebsd.org (Postfix) with ESMTP id 264ED1FA4 for ; Tue, 31 May 2016 22:06:59 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from [192.168.1.10] (unknown [192.168.1.10]) (Authenticated sender: allanjude.freebsd@scaleengine.com) by mx1.scaleengine.net (Postfix) with ESMTPSA id C4F69D3DB for ; Tue, 31 May 2016 22:06:58 +0000 (UTC) Subject: Re: Running FreeBSD docker images on non-FreeBSD hosts To: freebsd-virtualization@freebsd.org References: From: Allan Jude Message-ID: <42cc8e38-733d-4750-3490-562b241b1b62@freebsd.org> Date: Tue, 31 May 2016 18:06:54 -0400 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 May 2016 22:07:00 -0000 On 2016-05-31 17:02, Jeff Terrell wrote: > To work around the current inability to mount volumes in FreeBSD docker, > I'd like to use a FreeBSD docker image on a non-FreeBSD host. Then I can > both run FreeBSD in a docker container and mount a volume in the container, > both of which are necessary for my purposes. > > (For background, I'm trying to do this to extend jsass, the Java SASS > compiler [1], to work on FreeBSD. I started a thread documenting this > attempt on Github [2].) > > [1] https://github.com/bit3/jsass > [2] https://github.com/bit3/jsass/issues/40 > > Unfortunately, every FreeBSD image I can find requires a FreeBSD host to > run. This requirement is rarely documented, but it is absolute, at least at > the moment. For each image matching "freebsd" on Docker Hub, I pulled the > image, ran `docker run IMAGE_NAME ls`, and the command produced the output > I expected when I ran it on my FreeBSD machine, but not when I ran it on my > iMac. (I added comments on Docker Hub to this effect, to hopefully save > others some time and spare them some confusion.) > > 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? > > 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. > > Solving this problem could, of course, open some avenues for others to > discover and use FreeBSD relatively painlessly, so I'm thinking it would be > helpful in general to the FreeBSD community. > > Can somebody point me in the right direction here? > > Thanks, > Yes, FreeBSD docker images will require a FreeBSD host. You can't run Mac OS X applications on a Linux box either. It is a different operating system. You may be spoiled by the ability of a FreeBSD host to run some Linux images, via the linux_compat layer. The only way to run a FreeBSD docker image on another OS would be via a VM. I am not that familiar with docker, what do you mean by 'mount of a volume in the docker' -- Allan Jude