Hacker News new | comments | show | ask | jobs | submit login
Docker on OpenBSD 6.1 (medium.com)
61 points by iuguy 146 days ago | hide | past | web | 21 comments | favorite



Want to see a "real" effort to get Docker / Containers in (Free)BSD?

https://github.com/kvasdopil/docker

https://github.com/3ofcoins/jetpack

Unfortunately, they haven't been updated in a while. But this is what we mean when we want docker on other hosts. use FreeBSD's native jail and linux subsystems. In other words, "OS-level virtualization" [1]

Rather than treating other platforms like second class citizens and relying on ad-hoc workarounds that require virtualbox, a middleman linux distribution running in the background; not to mention the error-prone networking redirection the aforementioned introduces.

Two points:

1. The whole point of docker is to not have to haul in a linux distribution and a fire up a vm just to deploy something for development or production. If they're using Docker w/ a VM, they're better off just using Vagrant.

2. FreeBSD jails work fantastic. What's keeping docker from abstracting upon that and supporting it officially, especially seeing these two implementations in the wild?

I look forward to seeing more of kvasdopil's docker fork (https://www.freshports.org/sysutils/docker-freebsd/) and jetpack.

[1] https://en.wikipedia.org/wiki/Operating-system-level_virtual...


The FreeBSD port of Docker was unfortunately never merged, and needs completely reworking since it was written for the old monolithic Docker. There is some interest but no one actually working on it and I have been doing some portability fixes to containerd now and then but it needs some sustained effort.


You could configure dockerd (in the VM) to listen on TCP [1][2], then, back in OpenBSD, define & export `DOCKER_HOST` [3] and from then on use the 'docker' client on OpenBSD [4] without even having to ssh into Alpine.

Warning: I have not yet tested this yet, but it's about the same way as it works on macOS.

Also, I would have probably tried to use boot2docker [5] as guest instead of Alpine.

[1] https://docs.docker.com/engine/reference/commandline/dockerd...

[2] https://docs.docker.com/engine/security/https/

[3] https://docs.docker.com/engine/reference/commandline/cli/

[4] https://www.freshports.org/sysutils/docker/ (< you probably have to build it yourself)

[5] https://github.com/boot2docker/boot2docker


Brilliant! I totally forgot about boot2docker. I remember it from when the Docker tooling on macOS was rough.

I didn't notice the docker client was in the ports tree. I may have to give this a go later this week.


You can also use LinuxKit[1] on OpenBSD I believe; this is what we now use to build Docker for Mac and we are continuing to open source this code.

EDIT: we have an openbsd developer on the team that built LinuxKit and Docker for Mac, so we should be able to help fix any issues...

[1] https://github.com/linuxkit/linuxkit


Ultimately a good way to make this easier may be to use docker-machine and write some docker-machine-driver-vmm, like there is for e.g xhyve[0].

[0]: https://github.com/zchee/docker-machine-driver-xhyve


Docker is primarily for running Linux applications on Linux (yes, I know there are things like Joyent SDC, Docker Engine on Windows etc).

So if I run Docker in a Linux VM on OpenBSD, I don't think it counts as "Docker on OpenBSD", IMHO.


How about "Docker has evolved to packaging applications"? This is where things are today, with official support by Docker for non-Linux systems, and official support by non-Linux systems for Dockerised apps.


more like run a vm with linux on OpenBSD


(Full disclosure, I'm the author of the Medium post.)

It's essentially the way Docker for Mac works, though Docker for Mac has far more mature tooling these days. Before the switch to macOS's native Hypervisor.framework, it was very much running VirtualBox with a Linux VM as a "shim" if you will.

For local dev work it scratches an itch for me and maybe for the minority of folks wanting to use OpenBSD as their workstation OS. ("There are dozens of us. Dozens!")

Plus it's just fun to play with VMM. :-)


Yeah, this is Docker for OpenBSD in the same sense as Docker for Mac or Docker for Windows (before the very recent changes).

The naming convention is consistent, if a bit strange.


I read through the post, and thought, "Hold on, this isn't docker on OpenBSD, this is using OpenBSD's VM subsystem. Which is cool, but mostly unrelated to the title of the article."

The article is well written, but the title is kind of click bait. Why wouldn't you expect Docker (or any linux app for that matter) to run on a virtualization subsystem?

This would be similar to somebody getting Windows to run on vmm, and then writing an article, "Adobe Photoshop on OpenBSD"

Still a great article though. Recommended.


Exactly. I read the article more than once as thought i was missing something. This is really not Docker on BSD.


I'd wager their traffic is 1-2 orders of magnitude higher with this title than it would be otherwise. A while ago I did a bunch of work using Packer. I had encountered all sorts of interesting virtualization / networking / OS issues in the course of that work. But out of all that I wrote one blog post basically just saying I had started using the Docker builder in addition to what I was doing before. Most read blog post I've ever been involved with, by several landslides. It got picked up by several Docker bots on Twitter and retweeted by hundreds of people. Zero interesting technical content.


Cool project, but not what I expected it be.


For those that missed it, this also implies that OpenBSD now has native hardware-level virtualization support capable of running a real-world linux application..


Interesting. How did you find FreeBSD less Apple-laptop-friendly than OpenBSD? Did OpenBSD port the Broadcom Wi-Fi driver from Linux?


Suspend/resume seems to just work (at least when using X11) out of the box. I've had issues getting FreeBSD to work properly in the past, but maybe 12.0-CURRENT works better these days.

Sadly, no Broadcom support :-(


What are you doing for network access? Some sort of dongle-based connection?


I use an "Edimax EW-7811Un" (aka the N150-nano) usb wifi adapter. Only costs 8 USD on Amazon.

It uses the urtwn driver in OpenBSD and FreeBSD. It works...ok. Super small and a handy built in blue-LED so you know when it's powered and connected. I tend to leave it plugged in even when I reboot into macOS because it's pretty much ignored there due to lack of out of box macOS kernel module I believe.


I'm curious what "okay" means for you. I've got one of those tiny Edimax wifi USB adapters and it is intolerably slow. Is there some sort of performance tuning I'm missing?




Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | DMCA | Apply to YC | Contact

Search: