Sign inSign up

nunofgs/octoprint

By nunofgs

•Updated over 6 years ago

Dockerfile to set up Octoprint with x86, armv6, armv7 and arm64 support!

Image
28

5M+

nunofgs/octoprint repository overview

⁠OctoPrint

build status

This is a Dockerfile to set up OctoPrint⁠. It supports the following architectures automatically:

  • x86
  • arm32v6 1⁠
  • arm32v7
  • arm64

Just run:

docker run nunofgs/octoprint

Now have a beer, you did it. 🍻

⁠Tags

⁠Tested devices

DeviceWorking?
Raspberry Pi 2b✅
Raspberry Pi 3b+✅
Raspberry Pi Zero W✅

Please let me know if you test any others, would love to increase the compatibility list!

⁠Usage

$ docker run \
  --device=/dev/video0 \
  -p 80:80 \
  -v /mnt/data:/data \
  nunofgs/octoprint

⁠Environment Variables

VariableDescriptionDefault Value
CAMERA_DEVThe camera device node/dev/video0
MJPEG_STREAMER_AUTOSTARTStart the camera automaticallytrue
MJPEG_STREAMER_INPUTFlags to pass to mjpg_streamer-y -n -r 640x480

⁠CuraEngine integration

Cura engine integration was very outdated (using version 15.04.6) and was removed.

It will return once OctoPrint supports python3⁠ (needed for the newest versions of cura engine).

⁠Webcam integration

⁠USB Webcam

  1. Bind the camera to the docker using --device=/dev/video0:/dev/videoX
  2. Optionally, change MJPEG_STREAMER_INPUT to your preferred settings (ex: input_uvc.so -y -n -r 1280x720 -f 10)

⁠Raspberry Pi camera module

  1. The camera module must be activated (sudo raspi-config -> interfacing -> Camera -> set it to YES)
  2. Memory split must be at least 128mb, 256mb recommended. (sudo raspi-config -> Advanced Options -> Memory Split -> set it to 128 or 256)
  3. You must allow access to device: /dev/vchiq
  4. Change MJPEG_STREAMER_INPUT to use input_raspicam.so (ex: input_raspicam.so -fps 25)

* Raspberry PI camera support is only available in arm/v6 and arm/v7 builds at the moment.

⁠Octoprint configuration

Use the following settings in octoprint:

webcam:
  stream: /webcam/?action=stream
  snapshot: http://127.0.0.1:8080/?action=snapshot
  ffmpeg: /usr/bin/ffmpeg

⁠Notes

⁠Distro variants

There are currently alpine and debian variants available of this image. At time of writing, here are their sizes:

VariantSize
1.3.11-alpine474MB
1.3.11-debian889MB

While SD cards are pretty cheap these days, a smaller image is always preferrable so feel free to submit PRs that reduce the image size without affecting functionality!

⁠ARMv6 Docker Bug

ARM32v6 devices such as the Raspberry Pi Zero (W) are unfortunately unable to pull this image directly using docker pull nunofgs/octoprint due to a bug in Docker (moby/moby#37647⁠, moby/moby#34875⁠). There's a PR open⁠ to fix this but it might be some time until it hits a stable Docker release.

Until then, you can run this container by specifying the armv6 image hash. Example on HypriotOS 1.11.0⁠:

$ docker manifest inspect nunofgs/octoprint | grep -e "variant.*v6" -B 4

# copy sha256 hash of the v6 image you want to run.

$ docker run nunofgs/octoprint@sha256:dce9b67ccd25bb63c3024ab96c55428281d8c3955c95c7b5133807133863da29

⁠Toggle the camera on/off

This image uses supervisord in order to launch 3 processes: haproxy, octoprint and mjpeg-streamer.

This means you can disable/enable the camera at will from within octoprint by editing your config.yaml:

system:
  actions:
  - action: streamon
    command: supervisorctl start mjpeg-streamer
    confirm: false
    name: Start webcam
  - action: streamoff
    command: supervisorctl stop mjpeg-streamer
    confirm: false
    name: Stop webcam

⁠Credits

Original credits go to https://bitbucket.org/a2z-team/docker-octoprint⁠. I initially ported this to the raspberry pi 2 and later moved to a multiarch image.

⁠License

MIT

Tag summary

Content type

Image

Digest

Size

326.2 MB

Last updated

over 6 years ago

docker pull nunofgs/octoprint