So far my little experiment of using FreeBSD for development work has been very interesting and successful in many aspects. However I might be facing a major obstacle: I am developing a TypeScript application that depends on several services (redis, postgres, potentially RabbitMQ in conjunction with other TypeScript or Python services) and I absolutely need a working reliable docker setup running on FreeBSD. Any help on getting this to work is highly appreciated!
My initial idea was to virtualize the docker daemon and then access it remotely from the FreeBSD host. This where I am standing right now:
I am running a bhyve VM on my FreeBSD laptop with Debian installed and docker enabled, running with a configuration for remote network access. The daemon is successfully accessible via network. The docker-cli on the freebsd host, which is installable via this port, can connect to the remote docker daemon and run containers (such as hello-world) on the Debian VM. I can shutdown and restart the VM and the docker client just works. Which is really nice.
However there are some problems.
I) The docker client available in ports is coming without the
II) The filesystem on the host must be accessible to Docker inside the VM in order to update on changes. So that the hot-reload functionality of
Is it possible to share the filesystem between guest and host on bhyve? Or if not, how about Virtualbox instead of bhyve? I was also thinking about using either
Any suggestions helping to resolve these two main problems are highly welcome and appreciated! Also, since I consciously chose to try FreeBSD and my goal is to push it as far as possible here, I do not mind the time and effort that might be needed to get a more complicated solution working. The main thing is: Is it doable?
(Please note that this is NOT a thread on FreeBSD native alternatives to Docker. The setup must be interoperable with my existing Linux-based development workflow within the same git repo without major reconfiguration. Any FreeBSD native solution isn't really feasible here, at least to my knowledge)
Thanks in advance!
My initial idea was to virtualize the docker daemon and then access it remotely from the FreeBSD host. This where I am standing right now:
I am running a bhyve VM on my FreeBSD laptop with Debian installed and docker enabled, running with a configuration for remote network access. The daemon is successfully accessible via network. The docker-cli on the freebsd host, which is installable via this port, can connect to the remote docker daemon and run containers (such as hello-world) on the Debian VM. I can shutdown and restart the VM and the docker client just works. Which is really nice.
However there are some problems.
I) The docker client available in ports is coming without the
docker compose
command. I am not quite sure why, however it might simply be out of date. There is an older version of standalone docker-compose
in ports. That one however is simply too much behind to understand my current YAML files. Yet since my TypeScript app has several component services, I need a recent docker compose to manage this in development. I was thinking about building the newest version of docker cli from source but I haven't tried yet... any ideas on this issue?II) The filesystem on the host must be accessible to Docker inside the VM in order to update on changes. So that the hot-reload functionality of
ts-node
running inside the application container on the Debian VM (yes it is getting a little crazy) can pick up changes in the codebase on the FreeBSD host without me having to rebuild the container. My thought was that this might require mapping the local ZFS filesystem into the Linux VM somehow. However I am not sure at this point.Is it possible to share the filesystem between guest and host on bhyve? Or if not, how about Virtualbox instead of bhyve? I was also thinking about using either
sshfs
or nfs
to do this. However how reliable is this going to be once we are talking persisting data between container runs?Any suggestions helping to resolve these two main problems are highly welcome and appreciated! Also, since I consciously chose to try FreeBSD and my goal is to push it as far as possible here, I do not mind the time and effort that might be needed to get a more complicated solution working. The main thing is: Is it doable?
(Please note that this is NOT a thread on FreeBSD native alternatives to Docker. The setup must be interoperable with my existing Linux-based development workflow within the same git repo without major reconfiguration. Any FreeBSD native solution isn't really feasible here, at least to my knowledge)
Thanks in advance!