Need some clarity on docker setup

Status
Not open for further replies.

ChrisNAS

Explorer
Joined
Apr 14, 2017
Messages
71
Hello

I've got a standard FreeBSD jail setup as a webserver. On there I have nextcloud going. What I'm trying to accomplish now is getting collabora up for nextcloud online office capabilities.

However, I'm not finding anything about getting collabora installed on FreeBSD. And on the nextcloud docs it comes as a docker container. https://nextcloud.com/collaboraonline/

Never having used docker before, a search lead me to http://www.freenas.org/blog/docker-done-right/

I ssh'd to my jail and ran: pkg install docker-freebsd ca_root_nss

But then I stopped, wondering should if I be doing this inside the jail or on freenas?

The next line on the freenas page is to run: zfs create -o mountpoint=/usr/docker zroot/docker but I'm not sure what values to use there. After that I was going to run the next command from the nextcloud page to install: docker pull collabora/code and continuing from info on that page.

Is this correct or should I be doing this differently?

Thank you in advance.
 

Jailer

Not strong, but bad
Joined
Sep 12, 2014
Messages
4,975
Your docker host needs to be installed in a VM, FreeBSD does not have native Docker support.
 

ajschot

Patron
Joined
Nov 7, 2016
Messages
341
Hello

I've got a standard FreeBSD jail setup as a webserver. On there I have nextcloud going. What I'm trying to accomplish now is getting collabora up for nextcloud online office capabilities.

However, I'm not finding anything about getting collabora installed on FreeBSD. And on the nextcloud docs it comes as a docker container. https://nextcloud.com/collaboraonline/

Never having used docker before, a search lead me to http://www.freenas.org/blog/docker-done-right/

I ssh'd to my jail and ran: pkg install docker-freebsd ca_root_nss

But then I stopped, wondering should if I be doing this inside the jail or on freenas?

The next line on the freenas page is to run: zfs create -o mountpoint=/usr/docker zroot/docker but I'm not sure what values to use there. After that I was going to run the next command from the nextcloud page to install: docker pull collabora/code and continuing from info on that page.

Is this correct or should I be doing this differently?

Thank you in advance.

Install Linux in iohyve and install docker in Linux, or use FreeNAS Corral (not updated anymore)
 

ChrisNAS

Explorer
Joined
Apr 14, 2017
Messages
71
Really confused about all this docker on FreeBSD stuff.

Looking at this page, they make it seem rather easy: https://wiki.freebsd.org/Docker

It does say experimental with a "linux compatibility layer" but the install commands look straight-forward.

If this is indeed possible to run docker in the existing FreeBSD jail I already have running, that would be better than a whole separate jail, no?

I'm going to need the collabora docker container and the nextcloud in the existing jail to chitchat.
 

ddimick

Contributor
Joined
Feb 23, 2013
Messages
144
Native FreeBSD Docker support is a work in progress and some key features for FreeNAS users aren't there yet, like virtual networking. Networking in general looks like it has a ways to go. See https://github.com/kvasdopil/docker/blob/freebsd-compat/FREEBSD-PORTING.md.

So while it is not correct to say FreeBSD has no native Docker support, it still does not have feature parity to what you get with Linux running Docker. Since FreeNAS currently has no Docker management interface (outside of the Corral abandonware), I don't see much point in using FreeNAS as a hypervisor for this use case.
 

Jailer

Not strong, but bad
Joined
Sep 12, 2014
Messages
4,975
Give them time. iX is moving FreeNAS to FreeBSD 11 with the next update and Docker support is planned for a later update.
 

ChrisNAS

Explorer
Joined
Apr 14, 2017
Messages
71
BTW... I am running FN 11 nightlies. Forgot to mention that.

The docker container will simply be there to serve collabora for nextcloud, and with my very limited experience in this area, I assume that doing this in the Webserver jail would be better so that everything will be contained in the one jail.

I was intending to mesh the steps from following pages.

1) https://wiki.freebsd.org/Docker

pkg install docker-freebsd ca_root_nss

zfs create -o mountpoint=/usr/docker zroot/docker

sysrc -f /etc/rc.conf docker_enable="YES"

service docker start

2) https://nextcloud.com/collaboraonline/

docker pull collabora/code

docker run -t -d -p 127.0.0.1:9980:9980 -e 'domain=cloud\\.MYDOMAINHERE\\.com' --restart always --cap-add MKNOD collabora/code

(follow rest of info on nextcloud link for config)
 
Last edited:

ChrisNAS

Explorer
Joined
Apr 14, 2017
Messages
71
I've been trying to get this working, but getting some errors.

I added storage to the jail: Source:/host/vol/folder Destination: /usr/docker and checked the mounted box, assuming this would be the same as running the zfs/zpool commands (which did not work in the jail).

And when I run service docker start, I get "starting docker..." but nothing happens. I found in /var/log/docker.log the following:

Code:
time="2017-05-08T19:27:14.138514768-07:00" level=warning msg="Kernel version detection is available only on linux"
time="2017-05-08T19:27:14.138607996-07:00" level=debug msg="Warning: could not change group /var/run/docker.sock to docker: Group docker not found"
time="2017-05-08T19:27:14.138669879-07:00" level=debug msg="[graphdriver] trying provided driver \"zfs\""
time="2017-05-08T19:27:14.138683731-07:00" level=info msg="Listening for HTTP on unix (/var/run/docker.sock)"
time="2017-05-08T19:27:14.138777425-07:00" level=fatal msg="Error starting daemon: error initializing graphdriver: Failed to find zfs dataset mounted on '/usr/docker' in /proc/mounts"


Have no idea what to do from here. Not easy finding info on Docker on FreeBSD... just about everything I'm finding refers to Ubuntu and such.

I would very much appreciate if anyone has any suggestions.
 

KrisBee

Wizard
Joined
Mar 20, 2017
Messages
1,288
I would very much appreciate if anyone has any suggestions.

My suggestion, heed the advice you've already been given. The error messages are telling you that your container won't run in the docker environment you've created. Does a simple docker "hello world" or busybox container even run?

The ref. quoted by @ddimick shows the last commit was in 2015 and you can see it's status in FreeBSD freshports. But ask yourself a question, if there was workable native docker support in FreeBSD don't you think ixsystems would have used it in FreeNAS Corral? The docker host in FreeNAS Corral runs as a virtual machine based on a custom boot2docker image, and the future is supposedly rancheros, with rancher server and agents.

This ref might be of interest: https://www.cod3r.com/2017/01/docker-in-freenas-9-10/

But as a word of caution read this too:

https://forums.freenas.org/index.ph...ding-freenas-corral.53502/page-15#post-371294
 

Jailer

Not strong, but bad
Joined
Sep 12, 2014
Messages
4,975
if there was workable native docker support in FreeBSD don't you think ixsystems would have used it in FreeNAS Corral?
Perzactly.
 

ChrisNAS

Explorer
Joined
Apr 14, 2017
Messages
71
I did go the suggested route of iohyve and used ubuntu for docker. That was a long painful process since I've never done it before, and all the howtos I tried either left something out, were older, or I missed a small unclear detail (the kind you don't realize "yet").

However, having the two servers now introduced a new problem.... I'm stuck with 1 port (443) and 2 servers only accessible on that port. Grr...

Thanks for all the input though! Much appreciated.
 
Status
Not open for further replies.
Top