add custom octoprint dockerfile; add link about cross-building images to buildscript

This commit is contained in:
Markus Küffner
2021-11-03 19:54:52 +01:00
parent 2e9d342cc3
commit a1c0802cf5
3 changed files with 40 additions and 4 deletions

View File

@@ -1,5 +1,33 @@
ARG VERSION=minimal
FROM octoprint/octoprint:${VERSION}
## Install OctoPrint and Plugins in venv
FROM python:3 as build
COPY plugins.txt /tmp/plugins.txt
RUN pip install -r /tmp/plugins.txt
ARG VERSION=1.7.2
WORKDIR /opt
COPY plugins.txt plugins.txt
RUN python -m venv venv \
&& venv/bin/pip install OctoPrint==${VERSION} \
&& venv/bin/pip install -r plugins.txt
## Runtime Image
FROM python:3-slim as run
WORKDIR /opt
COPY --from=build /opt/venv venv
COPY apt.txt apt.txt
RUN apt update \
&& apt install -y $(grep -vE "^\s*#" apt.txt | tr "\n" " ") \
&& apt clean
RUN mkdir run cfg
RUN groupadd octoprint --gid 1000 \
&& useradd octoprint --uid 1000 --gid octoprint \
&& usermod octoprint --append --groups dialout \
&& chown -R octoprint:octoprint /opt/*
USER octoprint
EXPOSE 5000
VOLUME ["/opt/run", "/opt/cfg"]
ENTRYPOINT ["/opt/venv/bin/octoprint", "serve"]
CMD ["-b", "/opt/cfg"]

5
docker/octoprint/apt.txt Normal file
View File

@@ -0,0 +1,5 @@
# FilamentManager
psycopg2
# PrusaSlicerThumbnails
libjpeg62-turbo

View File

@@ -1,5 +1,8 @@
#!/bin/bash
## https://www.stereolabs.com/docs/docker/building-arm-container-on-x86/
## docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
set -e
registry=${1}