Skip to main content
added 994 characters in body
Source Link
etosan
  • 1.3k
  • 8
  • 10

If you want to have systemd inside container and you are running on systemd enabled system why bother with alien and non-standard crap like docker?

All up to date systemd systems support systemd-nspawnd containers natively: https://www.freedesktop.org/software/systemd/man/systemd-nspawn.html

These containers will run systemd inside natively and will have almost everyhting working, including service managment and other stuff. This type of container also does not depend on clunky docker hub silliness, so you can easily install any OS inside that is supported by your kernel.

In fact, nspawnd containers behave more like freebsd jails or real vms than some docker stuff. In your use case this would make perfect sense.

EDIT:

Sorry I did not notice you are on MacOS.

It's some time I was dealing with MacOS and I am pretty sure their linux emulation is nonexistant and even if it was the opposite case, you certainly can not succeed in loading this kernel module to completely different system architecture:

Failed to insert module 'autofs4': No such file or directory

I heard about some reasearch usermode linux kernel emulation written in go some years ago, but I am not entirely sure if docker is or even would be capable of handling that.

In short you are using the wrong tool for the given job.

Proper approach would be running lightweight VM and run systemd inside that. You can then mentally treat that VM as container, after all it does not matter.

If you really need to run some linux specific containerization engine to test your use cases, build a small centors/rhel/rocky VM and instal you containerization framewrok into it (nspawn is present by default though).

If you want to have systemd inside container and you are running on systemd enabled system why bother with alien and non-standard crap like docker?

All up to date systemd systems support systemd-nspawnd containers natively: https://www.freedesktop.org/software/systemd/man/systemd-nspawn.html

These containers will run systemd inside natively and will have almost everyhting working, including service managment and other stuff. This type of container also does not depend on clunky docker hub silliness, so you can easily install any OS inside that is supported by your kernel.

In fact, nspawnd containers behave more like freebsd jails or real vms than some docker stuff. In your use case this would make perfect sense.

If you want to have systemd inside container and you are running on systemd enabled system why bother with alien and non-standard crap like docker?

All up to date systemd systems support systemd-nspawnd containers natively: https://www.freedesktop.org/software/systemd/man/systemd-nspawn.html

These containers will run systemd inside natively and will have almost everyhting working, including service managment and other stuff. This type of container also does not depend on clunky docker hub silliness, so you can easily install any OS inside that is supported by your kernel.

In fact, nspawnd containers behave more like freebsd jails or real vms than some docker stuff. In your use case this would make perfect sense.

EDIT:

Sorry I did not notice you are on MacOS.

It's some time I was dealing with MacOS and I am pretty sure their linux emulation is nonexistant and even if it was the opposite case, you certainly can not succeed in loading this kernel module to completely different system architecture:

Failed to insert module 'autofs4': No such file or directory

I heard about some reasearch usermode linux kernel emulation written in go some years ago, but I am not entirely sure if docker is or even would be capable of handling that.

In short you are using the wrong tool for the given job.

Proper approach would be running lightweight VM and run systemd inside that. You can then mentally treat that VM as container, after all it does not matter.

If you really need to run some linux specific containerization engine to test your use cases, build a small centors/rhel/rocky VM and instal you containerization framewrok into it (nspawn is present by default though).

Source Link
etosan
  • 1.3k
  • 8
  • 10

If you want to have systemd inside container and you are running on systemd enabled system why bother with alien and non-standard crap like docker?

All up to date systemd systems support systemd-nspawnd containers natively: https://www.freedesktop.org/software/systemd/man/systemd-nspawn.html

These containers will run systemd inside natively and will have almost everyhting working, including service managment and other stuff. This type of container also does not depend on clunky docker hub silliness, so you can easily install any OS inside that is supported by your kernel.

In fact, nspawnd containers behave more like freebsd jails or real vms than some docker stuff. In your use case this would make perfect sense.