mirror of
https://github.com/mkuf/prind.git
synced 2025-11-04 20:36:09 +01:00
add custom octoprint dockerfile; add link about cross-building images to buildscript
This commit is contained in:
@@ -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
5
docker/octoprint/apt.txt
Normal file
@@ -0,0 +1,5 @@
|
||||
# FilamentManager
|
||||
psycopg2
|
||||
|
||||
# PrusaSlicerThumbnails
|
||||
libjpeg62-turbo
|
||||
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user