Code Monkey home page Code Monkey logo

docker-octoprint's Introduction

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

Device Working?
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

Variable Description Default Value
CAMERA_DEV The camera device node /dev/video0
MJPEG_STREAMER_AUTOSTART Start the camera automatically true
MJPEG_STREAMER_INPUT Flags 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:

Variant Size
1.3.11-alpine 474MB
1.3.11-debian 889MB

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

docker-octoprint's People

Contributors

danielmoore avatar jacob-swanson avatar nunofgs avatar reloxx13 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.