From cfb81ae0915fdcf8b252815a2e2579d36615e924 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20K=C3=BCffner?= Date: Mon, 8 Nov 2021 22:21:28 +0100 Subject: [PATCH] set python version for octoprint image; add runtime packages for octoprint --- docker/octoprint/Dockerfile | 8 +++++--- docker/octoprint/apt.txt | 8 ++++---- scripts/build-images.sh | 7 ++++++- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/docker/octoprint/Dockerfile b/docker/octoprint/Dockerfile index aa3f01d..878a599 100644 --- a/docker/octoprint/Dockerfile +++ b/docker/octoprint/Dockerfile @@ -1,5 +1,7 @@ +ARG PYTHON_VERSION=3.9 + ## Install OctoPrint and Plugins in venv -FROM python:3 as build +FROM python:${PYTHON_VERSION} as build ARG VERSION=1.7.2 @@ -10,7 +12,7 @@ RUN python -m venv venv \ && venv/bin/pip install -r plugins.txt ## Runtime Image -FROM python:3-slim as run +FROM python:${PYTHON_VERSION}-slim as run WORKDIR /opt COPY --from=build /opt/venv venv @@ -30,4 +32,4 @@ RUN groupadd octoprint --gid 1000 \ EXPOSE 5000 VOLUME ["/opt/run", "/opt/cfg"] ENTRYPOINT ["/opt/venv/bin/octoprint", "serve"] - CMD ["-b", "/opt/cfg"] \ No newline at end of file + CMD ["-b", "/opt/cfg"] diff --git a/docker/octoprint/apt.txt b/docker/octoprint/apt.txt index 0a42287..d421d7e 100644 --- a/docker/octoprint/apt.txt +++ b/docker/octoprint/apt.txt @@ -1,5 +1,5 @@ -# FilamentManager -psycopg2 - # PrusaSlicerThumbnails -libjpeg62-turbo \ No newline at end of file +libopenjp2-7 +libjpeg62-turbo +libtiff5 +libxcb1 diff --git a/scripts/build-images.sh b/scripts/build-images.sh index a3031f4..d6d0860 100755 --- a/scripts/build-images.sh +++ b/scripts/build-images.sh @@ -1,7 +1,12 @@ #!/bin/bash -## https://www.stereolabs.com/docs/docker/building-arm-container-on-x86/ +## Setup for building multiplatform images +## +## apt install qemu-user-static ## docker run --rm --privileged multiarch/qemu-user-static --reset -p yes +## docker buildx create --use --name cross +## docker buildx inspect --bootstrap +## docker buildx build --platform linux/amd64,linux/arm/v7 -t octoprint:latest --target run . set -e