general/other Linux docker & docker compose in 2025

Hey, I wanted to understand what is the state of Linux dockers execution and docker's compose.yaml on FreeBSD.

I've tried to read various articles and that forum thread, but I'm still not sure I understand if there is some easy way to start ready to use Linux Dockers? Ideally, by re-utilizing docker`s compose.yml, but that could wait.

I have some Linux server which only goal - is to run docker's and reverse proxy - I would rather migrate them to FreeBSD, if I can.
I understand that I will need to start some compatibility Linux level (guess Linuxulator ?), but I don't mind doing so, if that would give me an ability to switch.

I would appreciate any help with that!
 
Instead of trying to crowbar docker services into FreeBSD, why not just install those services directly on FreeBSD? Don't know which services you need but they might run natively on FreeBSD.
 
I was (and still) looking for the way to run any docker service. That is the biggest benefit of Docker - for the cases when you don't care and you just need that something to be running - it is perfect.

And I have quite plenty of those things. So my perfect solution would be, if possible, to have an ability to run most if not any of those.
 
I'm looking for some hands-on experience with that :)

Or at least, some theory, like, for example:


sysrc linux_enable="YES"
service linux start
pkg install docker docker-compose debootstrap # I'm incompatible with RedHat's stuff
debootstrap jammy /compat/ubuntu # not sure if it's needed for Docker?
cd directory_with_compose_file
podman compose -d
 
linux_enable, linux service I think are for "running prebuilt linux executables on a FreeBSD system, aka Linuxulator".
Docker images should not need that, even if you have a "docker image built on a linux system".
I'm guessing docker-compose is creating a docker image from a "spec", a different way of creating a Dockerfile?
I think in theory "a docker image is a docker image regardless of where it's created, the contents of docker image don't really need host support, the docker layer translates between docker and host".
At least that's been my experience.
 
linux_enable, linux service I think are for "running prebuilt linux executables on a FreeBSD system, aka Linuxulator".
Docker images should not need that, even if you have a "docker image built on a linux system".
I'm guessing docker-compose is creating a docker image from a "spec", a different way of creating a Dockerfile?
I think in theory "a docker image is a docker image regardless of where it's created, the contents of docker image don't really need host support, the docker layer translates between docker and host".
At least that's been my experience.
With containers the kernel is shared., so any translation is done by the Linuxulator if you're running Linux images.

Just install podman and try docker-compose.
 
  • Like
Reactions: mer
> Just install podman and try docker-compose.

If I won't find any ready to use recipe - that's what I will do for sure.

> "docker image built on a linux system"

Good point, thanks - I never do docker build on the server, so it's only a question of `docker run`

> I'm guessing docker-compose is creating a docker image from a "spec"

Kind of - it's a config file for the docker, so that you wouldn't need to specify all options in the command line every time. Very convenient!
 
You're on a different platform. Your expectations are misplaced. Time to learn new things.

Use bastille if you want that sort of convenience.
 
Would you mind to elaborate?

If you meant that I shall stop using Docker and use Bastille BSD - because it's X & Y - I would consider that, but only once at least 70% of the ready to use apps for which I have no special requirements or that has been packed in Docker would migrate to whatever else: it's a pure calculation and wise dedication of the time in my life, which I don't have any extra.
Unless, of course, you know some nice fund, that pays for repackaging software from Docker, including proprietary in-house development - free of charge.

If you meant that Bastille has some special support to Docker & Docker-compose - then I didn't find any... Please, let me know what I'm missing!
And if Bastille has some special features on the topic - then it could be "backported" to the base - FreeBSD, which is something I'm interested.

My question is far from flame wars - it is purely functional. I'm getting less surprises with FreeBSD - less time for administering, more time for something of the value. I just need those Dockers things running, without virtualization. I adore vm-bhyve, but it's an additional layer of complexity - both mental and computational - not suitable for that case.
 
I am not a docker guy and really not an expert, I've tried it a bit in a Linux VM months ago and that was it, didn't ditch the VM but I let it rotten since I am not much interested.
But for the purpose of this thread I decided to try docker in a FreeBSD VM, so I installed sysutils/podman and sysutils/podman-compose and mostly follow the instructions included in packages.

podman seems to work with basics stuff I tried but I didn't go far(because I do not really care).
podman-compose looks like more picky, you can't take a recipe from whatever repo and expect it to work OTB, looks like it needs some adjustments (path? env variables?) I don't know, I didn't search more than that but it does not look like something one cannot fix.

It was just to see if it could work on FreeBSD and it looks like it works, mostly.
You cannot run containers with an unprivileged user like Linux does.
Can a container run in jail? should be worth a try.
Something funny, jls detects running podman containers too.

I understand what Beastie7 said, but on the other hand sysutils/podman and sysutils/podman-compose are already available in ports, what can we expect now?
Obviously people will run FreeBSD with hope of running docker, because it's possible. And from what I've read several times lot of them want that, why? I don't know.

Interesting links that basically explain how to getting start with docker(podman) on FreeBSD (other links I found were just mostly "made in AI", a copy/paste of instructions from the packages listed above, this is so tragic) :
 
I am not a docker guy and really not an expert, I've tried it a bit in a Linux VM months ago and that was it, didn't ditch the VM but I let it rotten since I am not much interested.
But for the purpose of this thread I decided to try docker in a FreeBSD VM, so I installed sysutils/podman and sysutils/podman-compose and mostly follow the instructions included in packages.

podman seems to work with basics stuff I tried but I didn't go far(because I do not really care).
podman-compose looks like more picky, you can't take a recipe from whatever repo and expect it to work OTB, looks like it needs some adjustments (path? env variables?) I don't know, I didn't search more than that but it does not look like something one cannot fix.

podman-compose is based on Python and deprecated for docker-compose, which is written in Golang:


It was just to see if it could work on FreeBSD and it looks like it works, mostly.
You cannot run containers with an unprivileged user like Linux does.
Can a container run in jail? should be worth a try.
Something funny, jls detects running podman containers too.

Containers in FreeBSD are jails. I haven't tried Docker on FreeBSD yet. Podman just worked for me to run Linux images.
 
Your question reminded me of a post that referenced this podman page. In that link search for “download images using podman”.

Haven’t tried myself, but from the page description looks like you can run Linux docker containers transparently on FreeBSD.

Good luck!
 
podman-compose is based on Python and deprecated for docker-compose, which is written in Golang:
podman-compose — Podman documentation
May be I missed something and you surely know better than me about this but I see nothing about podman-compose being deprecated. Its github repo has lot of unsolved issue though.
What I did find out podman can run a sub-command called compose which launch podman-compose or docker-compose.
BTW does it matter that much if the wrapper and the original program aren't written in same language?

Containers in FreeBSD are jails.
Container as in docker/podman container you mean?
If that's so I probably need to get use to it, I won't lie it feels strange.
Thanks for your reply.

I haven't tried Docker on FreeBSD yet. Podman just worked for me to run Linux images.
During my short tests, Linux images worked fine too.
Even if I am not a docker user I recon that efforts and work have been done to port that technology to FreeBSD.
 
May be I missed something and you surely know better than me about this but I see nothing about podman-compose being deprecated. Its github repo has lot of unsolved issue though.
What I did find out podman can run a sub-command called compose which launch podman-compose or docker-compose.
BTW does it matter that much if the wrapper and the original program aren't written in same language?


Container as in docker/podman container you mean?
If that's so I probably need to get use to it, I won't lie it feels strange.
Thanks for your reply.


During my short tests, Linux images worked fine too.
Even if I am not a docker user I recon that efforts and work have been done to port that technology to FreeBSD.
There's podman-compose and "podman compose". The first is a Python script with lots of dependencies and the latter is a podman subcommand that supports the docker-compose plugin written in Golang, faster and better than the Python version.

And yes, by containers I mean OCI containers, the ones used by docker & podman.
 
There's podman-compose and "podman compose". The first is a Python script with lots of dependencies and the latter is a podman subcommand that supports the docker-compose plugin written in Golang, faster and better than the Python version.
Okay so if I read between lines one is better but both are okay.
Thank you.
 
I was (and still) looking for the way to run any docker service. That is the biggest benefit of Docker - for the cases when you don't care and you just need that something to be running - it is perfect.

And I have quite plenty of those things. So my perfect solution would be, if possible, to have an ability to run most if not any of those.
If you don't want to use podman or jails your best bet is to use bhyve. Install an alpine instance, install docker in it and go nuts.

I quite like Alpine, its super small and snappy. However, If you do use it be sure to install dnsmasq as dns resolution can be wonky out of the box. The source of the issue is that Alpine uses busybox and busybox uses musl instead of glibc. It's easy enough to address

Code:
# from https://bell-sw.com/blog/how-to-deal-with-alpine-dns-issues/
apk add dnsmasq

cat > /etc/resolv.conf << EOF
127.0.0.1
EOF

cat >> /etc/dnsmasq.conf << EOF
port=53
listen-address=127.0.0.1
strict-order
no-resolv
no-poll
server=IP_address_1
server=IP_address_2
EOF

rc-update add dnsmasq default
rc-service dnsmasq start
 
Back
Top