Im using Octoprint for my Ender3 on a old Linux 32 bit machine. Unfortunately I was running into problems after a release upgrade of Ubuntu and so I finally decided that it is time to use Octoprint as a Docker image, so that I have the possibility to restore my services easily in the future.

For some strange reasons the official Octoprint on Docker Hub is only supporting 16 bit on ARM but not 16 bit Intel processors! However Octoprint is just a simple Python application, so it should not be too difficult to have a solution which runs on all environments that are supported by the official Python Image.

Here is the solution:

Dockerfile

FROM python
RUN pip install octoprint
RUN useradd octoprint &&  usermod -a -G tty octoprint &&  usermod -a -G dialout octoprint
USER octoprint
WORKDIR /home/octoprint
EXPOSE 5000
CMD octoprint serve

I am usually also using docker-compose – so here is the definition:

docker-compose.yml

version: "3.0"
services:
  octoprint:
    ports:
      - "80:5000"
    restart: always
    build: .
    privileged: true
   volumes:
      - .:/home/octoprint

The privileged: true setting is necessary to give Docker access to the serial (printer) devices.
The cool thing is

  • that I can access it directly on port 80 now w/o the need to install any other proxies
  • and that I have the automatic startup automatically taken care of by Docker as well.
  • Last but not least I can get the solution back on any new environment just by running docker-compose up -d

There is one pitfall however: The printer needs to be connected when the service is starting up or the port will not be found!

Categories: 3D Printing

0 Comments

Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *