# Using Docker in freeBSD



## humphrayLegare (Jan 9, 2019)

Hi community, I was wondering about something if it could be done or not. Actually, at work we use docker from time to time. I prefer working on BSD but Docker not being supported anymore on BSD makes it a bit complicate for me to use it. Actually I was thinking about using the linux ABI on BSD for installing docker in the linux userland on my BSD. So my question is, would that be possible to use Docker with its (linux version) in the linux. Something like /compat/linux/usr/bin/docker ?

Thank you


----------



## drhowarddrfine (Jan 9, 2019)

Docker isn't supported on FreeBSD?


----------



## _martin (Jan 9, 2019)

Simple answer is what drhowarddrfine said - it's not supported. Really, it's not. FreeBSD's jails do work fine and I found it more suiting for my (note: highly subjective) needs. You're wasting your time to make docker work on current FreeBSD -- it's not worth it. Either turn to jails, VMs (VirtualBox, some corner cases _maybe bhyve) or turn to Linux directly. 
But drhowarddrfine answer is the most suiting in this case.


----------



## Phishfry (Jan 10, 2019)

I don't use it but there is some work out there.
There has been a maintainer reset and the new maintainer took over 4 days ago.
sysutils/docker-freebsd/


----------



## Remington (Jan 10, 2019)

Docker doesn't work very well natively in FreeBSD. You're better off installing Debian Linux in Bhyve and install Docker inside Debian.  What that FreeBSD Docker does is install lightweight (CentOS, Ubuntu, Debian) linux in Bhyve so it basically does the same thing as installing regular Linux in Bhyve.

I prefer Jail or Bhyve since both are very stable, mature, easy to setup and destroy.  Docker is just another container as much as VirtualBox, etc.


----------



## Phishfry (Jan 10, 2019)

Didn't FreeNAS use Docker for a spell before switching to bhyve?


----------



## Remington (Jan 10, 2019)

Phishfry said:


> Didn't FreeNAS use Docker for a spell before switching to bhyve?



They did but Docker wasn't up to date with current FreeBSD/FreeNAS version as it wasn't well maintained.  Bhyve can do it much better running Linux VMs inside FreeBSD and it is far more stable.  I've been running Debian in Bhyve for over a month without a restart while Docker are known to crash from time to time.

Running Debian in Bhyve doesn't take much resources if not running GUI or anything.


----------



## drhowarddrfine (Jan 10, 2019)

I asked the question because I'm confused. It's stated Docker isn't supported anymore on FreeBSD yet there is a port for Docker.


----------



## humphrayLegare (Jan 10, 2019)

Thank you all  for your replies !


----------



## SirDice (Jan 14, 2019)

drhowarddrfine said:


> I asked the question because I'm confused. It's stated Docker isn't supported anymore on FreeBSD yet there is a port for Docker.





> Docker on FreeBSD is experimental.


https://wiki.freebsd.org/Docker


----------



## m0nkey_ (Jan 14, 2019)

Phishfry said:


> Didn't FreeNAS use Docker for a spell before switching to bhyve?


It used Docker inside a Linux VM (bhyve), it's never been supported natively.


----------



## tommiie (Jan 14, 2019)

The question on Jails vs. docker instances was also asked on Server Fault.


----------



## sadaszewski (May 27, 2020)

https://github.com/sadaszewski/focker/ is now the closest you can get to the Docker experience on FreeBSD. It doesn't aim for Docker compatibility but provides the same abstractions (images, volumes, containers), image building recipes, the useful "docker"-compose functionality and more. It is fully native to FreeBSD - leverages ZFS snapshots and clones to implement the image layering mechanism and jails for containers.


----------

