
Docker on OpenBSD 6.1 - iuguy
https://medium.com/@dave_voutila/docker-on-openbsd-6-1-current-c620513b8110
======
git-pull
Want to see a "real" effort to get Docker / Containers in (Free)BSD?

[https://github.com/kvasdopil/docker](https://github.com/kvasdopil/docker)

[https://github.com/3ofcoins/jetpack](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/](https://www.freshports.org/sysutils/docker-freebsd/)) and jetpack.

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

~~~
justincormack
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.

------
cimnine
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...](https://docs.docker.com/engine/reference/commandline/dockerd/#daemon-
socket-option)

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

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

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

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

~~~
voutilad
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.

~~~
justincormack
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](https://github.com/linuxkit/linuxkit)

------
sigjuice
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.

~~~
solarengineer
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.

------
0x006A
more like run a vm with linux on OpenBSD

~~~
voutilad
(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. :-)

~~~
jsight
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.

------
fapjacks
Cool project, but not what I expected it be.

------
cat199
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..

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

~~~
voutilad
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 :-(

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

~~~
voutilad
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.

~~~
peatmoss
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?

