From d4658e45f0bfdefdd068d2bf10ed78c3a1ed1e14 Mon Sep 17 00:00:00 2001 From: Jan Pazdziora Date: Wed, 27 Dec 2023 14:05:36 +0100 Subject: [PATCH] Allow the `apt-get` steps to be cached when rebuilding with different `octoprint_ref` build argument. --- minimal/Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/minimal/Dockerfile b/minimal/Dockerfile index aefa80f..e37bacf 100644 --- a/minimal/Dockerfile +++ b/minimal/Dockerfile @@ -2,9 +2,6 @@ ARG PYTHON_BASE_IMAGE=3-slim-buster FROM python:${PYTHON_BASE_IMAGE} AS build -ARG octoprint_ref -ENV octoprint_ref ${octoprint_ref:-master} - RUN apt-get update && apt-get install -y \ build-essential \ curl \ @@ -26,6 +23,9 @@ ENV PYTHONUSERBASE /octoprint/plugins ENV PIP_USER true ENV PATH "${PYTHONUSERBASE}/bin:${PATH}" +ARG octoprint_ref +ENV octoprint_ref ${octoprint_ref:-master} + RUN mkdir tmp && curl -fsSLO --compressed --retry 3 --retry-delay 10 \ https://github.com/OctoPrint/OctoPrint/archive/${octoprint_ref}.tar.gz \ && tar xzf ${octoprint_ref}.tar.gz --strip-components 1 -C tmp \