My 2c on running Docker on FreeBSD:

1) I’m using Docker and Kubernetes quite extensively during my work days so I 
tried to run Docker on FreeBSD in my free time because.. why not?
First I tried to run boot2docker project in VirtualBox as I remember that it 
was the way to run Docker on OSX a long time ago. Unfortunately, I had too much 
problems with it so I switched to running boot2docker inside bhyve. It was 
running alright, no major issues, no crashes so I went down that path. I 
improved a little bit my setup and wrote down a small tutorial for myself. You 
can find it here: 
https://github.com/kiela/kiela.github.io/blob/master/Docker%20on%20FreeBSD%20-%20%5Bpart%204%5D%20Using%20vm-bhyve.md
I’ve been using this as a Docker Swarm cluster running Nextcloud, PostgreSQL 
and a bunch of other containers inside it. Upgrading FreeBSD (host) or 
boot2docker (guest) or containers worked like a charm. And I’ve been using this 
for last 6+ months. Maybe this will help someone to start playing with Docker 
on FreeBSD and save some time figuring out how to do it.

2) Docker is not just running single image, managing volumes and networks - 
it’s much more. For example Docker Swarm which allows clustering and running 
whole application stack (multiple apps, DB, cache, logs etc) in a cluster which 
hosts are running on FreeBSD. I’m not trying to discourage anyone from porting 
Docker to FreeBSD. I would love to have Docker natively supported in FreeBSD. I 
just think that if one wants to just get up and running Docker on FreeBSD for 
development/tests/personal use, boot2docker+bhyve should be enough. Maybe 
wrapping it in a nice tool like vm-bhyve did with bhyve. If one wants to use 
Docker in production, one should strongly consider running Kubernetes cluster 
and use Docker images there.


--
Kamil Kieliszczyk

On 23 January 2019 at 22:09:32, Grzegorz Junka ([email protected]) wrote:


On 23/01/2019 03:21, ss griffon wrote:
> I'm a bit late to the game, but I wanted to add my 2 cents.  I don't  
> see the benefit of implementing "docker" in FreeBSD.  If you are just  
> implementing the linux system calls i.e. using the linuxulator, then  
> you lose any benefits of running on FreeBSD.  It seems like  
> implementing the docker interfaces, like a Dockerfile, registry  
> support and networking switches using FreeBSD specific implementations  
> would be extremely helpful.  Especially for the CI/CD workflow.
>
> For example:
> #Dockerfile
>
> #Pull a image from registry and create a new dataset with snapshot.
> #Registry could be http, ftp or any other transfer protocol.
> FROM FreeBSD:RELEASE-11.2
>
> #Copy app directory into the jailed directory.  Perhaps setting system  
> immutable flag.
> COPY ./app /app
>
> #Use pf to route to port 80 from the host.  Or use vnet
> EXPOSE 80
>
> #Run a command in the jail to prepare the new image.
> RUN env ASSUME_ALWAYS_YES=yes pkg install bash nginx uwsgi py36-flask
>
> #Mark the startup command
> CMD /bin/sh /etc/rc
>
>
> The above would be very familiar to docker users and can be used to  
> generate a standards compliant image (I believe there was a project  
> jetpack that did something like this). Creating a OCI compliant image  
> would probably be the first step to using kubernetes, but I haven't  
> really spent any time looking at kubernetes.
>
> We could also add extensions for using resource limits, capsicum,  
> devd, security levels etc.  The other cool thing is this could all be  
> run inside a jail using heirarchical jails.
>

Isn't implementing "docker" on FreeBSD the same as implementing OCI  
specification, i.e. runtime-spec? Seeing that OCI was founded by Docker  
I would have thought they align the docker implementation with the spec?

Then to extend that question, wouldn't adding support for docker to  
FreeBSD mean to add OCI compliance layer to jails? I don't think the  
plan is to add support for Linux containers, or "containerization", to  
FreeBSD kernel?

GrzegorzJ


_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-virtualization
To unsubscribe, send any mail to 
"[email protected]"

Attachment: signature.asc
Description: Message signed with OpenPGP using AMPGpg

Reply via email to