mirror of
https://github.com/mkuf/prind.git
synced 2025-10-26 07:46:19 +01:00
Moonraker packaged in Docker
What is Moonraker?
Moonraker is a Python 3 based web server that exposes APIs with which client applications may use to interact with the 3D printing firmware Klipper. Communcation between the Klippy host and Moonraker is done over a Unix Domain Socket. Tornado is used to provide Moonraker's server functionality.
via https://moonraker.readthedocs.io/en/latest/
Usage
Moonraker requires Klipper to operate. See the Images' README.md on how to run the Klipper Image.
Both Containers need to share their run Volume in order to be able to communicate via klippers unix socket. Configure Moonraker to use /opt/run/klipper.sock as klippys uds address.
Create moonraker.cfg and printer.cf as well as the directories run and gcode, then run the containers.
Run
docker run \
--device /dev/ttymxc3:/dev/ttymxc3 \
-v $(pwd)/run:/ \
-v $(pwd)/gcode:/opt/gcode \
-v $(pwd)/printer.cfg:/opt/cfg/printer.cfg \
mkuf/klipper:latest
docker run \
-v $(pwd)/run:/ \
-v $(pwd)/gcode:/opt/gcode \
-v $(pwd)/moonraker.cfg:/opt/cfg/moonraker.cfg \
-p 7125:7125 \
mkuf/moonraker:latest
Compose
services:
klipper:
image: mkuf/klipper:latest
devices:
- /dev/ttymxc3:/dev/ttymxc3
volumes:
- ./printer.cfg:/opt/cfg/printer.cfg
- ./run:/opt/run
- ./gcode:/opt/gcode
moonraker:
image: mkuf/moonraker:latest
ports:
- "7125:7125"
volumes:
- ./moonraker.cfg:/opt/cfg/moonraker.cfg
- ./run:/opt/run
- ./gcode:/opt/gcode
Defaults
| Entity | Description |
|---|---|
| User | moonraker (1000:1000) |
| Workdir | /opt |
| Entrypoint | /opt/venv/bin/python moonraker/moonraker/moonraker.py |
| Cmd | -c cfg/moonraker.cfg |
Ports
| Port | Description |
|---|---|
7125/tcp |
Default Webapi Port |
Volumes
| Volume | Description |
|---|---|
/opt/run |
Default Location for runtime Files generated by Klipper. Used to access klipper.sock, the unix socket that is used for communation with klipper |
/opt/cfg |
Config directory to host moonraker.cfg |
/opt/gcode |
Stores uploaded GCODE Files |
Tags
| Tag | Description | Static |
|---|---|---|
latest/nightly |
Refers to the most recent runtime Image. | May point to a new build within 24h, depending on code changes in the upstream repository. |
<7-digit-sha> eg: d37f91c |
Refers to a specific commit SHA in the upstream repository. eg: Arksine/moonraker:d37f91c | Yes |
Targets
| Target | Description | Pushed |
|---|---|---|
build |
Pull Upstream Codebase and build python venv | No |
run |
Default runtime Image | Yes |