(Still working in progress, may not work yet)
- Check guide from start to end
- Do not pass whole /dev/ to container, but use udev rules to pass specific devices
Guide/helpers how to run Klipper/Moonraker/Mainsail/Fluidd in Docker container via kiuah (https://github.com/th33xitus/kiauh)
It crates docker container with systemd & kiuah
- Follow this guide only if you know what are you doing (scripts are short, you can read them)
- Used guide may not be the best from security point of view
- Executed container/deamon will keep restarting on failure (could consume lot of resources if you keep it restarting)
- Get dependencies on your machine
- bash, git (e.g. apt install bash git)
- docker (e.g. from https://get.docker.com/)
- Clone repository & enter to the directory
git clone https://github.com/ybznek/docker-kiauh.git
cd docker-kiauh/
- Check/modify config file
You may want to modify config file, especially "klipperConfigInRoot"
./config
- Build docker image
./docker-kiuah build
- Run docker container as daemon
./docker-kiuah runDaemon
- Check status
./docker-kiuah status
There should be sth like
4ead22c9eee2 klipper "/lib/systemd/systemd" 23 seconds ago Up 22 seconds printer
If you see sth like go to "Troubleshoot" section
b518f4e79feb klipper "/lib/systemd/systemd" 2 seconds ago Restarting (255) Less than a second ago printer
- Execute kiuah & install what you want
./docker-kiuah kiuah
- (Optional) open terminal (bash) in container
./docker-kiuah bash
If container keeps failing, you can use this command to execute to see output
./docker-kiuah run
Usually it keeps failing due to cgroups (you can try to find some generic solution for "systemd in docker", it should help here)
On Ubuntu x86_64 (standard desktop)
- Add systemd.unified_cgroup_hierarchy=0 to /etc/default/grub e.g. :
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash systemd.unified_cgroup_hierarchy=0"
- Run
sudo update-grub
- Restart PC
On RPI 4 aarch64 (64 bit OS)
- add systemd.unified_cgroup_hierarchy=false to /boot/cmdline.txt e.g. :
console=serial0,115200 console=tty1 root=PARTUUID=14b2f967-02 rootfstype=ext4 fsck.repair=yes rootwait systemd.unified_cgroup_hierarchy=false
- Restart RPI
Try to execute container in different way, check https://hub.docker.com/r/jrei/systemd-debian