How to run *BSD (Open, Free, etc.) on Docker?
I am using Docker for Mac.
But There is no BSD image on Docker Hub.
How I can run it?
It's a container format not an emulation or virtualization platform. So, no, there are no FreeBSD docker images, just as there are no Windows or MacOS docker images. The only reason you can run docker images on Windows is because of WSL.
You can run both Linux and Windows programs and executables in Docker containers. The Docker platform runs natively on Linux (on x86-64, ARM and many other CPU architectures) and on Windows (x86-64). Docker Inc. builds products that let you build and run containers on Linux, Windows and macOS.
"FreeBSD jails are the original 'container'" FreeBSD jails pre-date containers like Docker by a long shot and as such, are far more straightforward.
The docker run command first creates a writeable container layer over the specified image, and then starts it using the specified command. That is, docker run is equivalent to the API /containers/create then /containers/(id)/start .
Docker doesn't actually run a full OS. Because it uses the host's kernel to run the container contents, it's not able to run a different kernel than the one used by its host OS. Further, as far as I understand, Docker relies on Linux-specific features for its fundamental operation. So it's not possible to run it with a BSD or another non-Linux kernel, including the XNU kernel used by MacOS, as its host environment. On a Mac, Docker actually runs within a virtualized Linux environment, so its host environment is Linux.
Now, in theory, if someone got a BSD userland to run on a Linux kernel, it might be possible to have a nearly-BSD Docker container. However, some research suggests that no project doing this has succeeded.
All of that means that there's no way to run a true BSD as a Docker image, which is why there is no BSD image for Docker.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With