From ab4a2a575e3a49177e328884ec57ec7cac2d3566 Mon Sep 17 00:00:00 2001 From: "B. Bergeron" Date: Mon, 25 Aug 2025 23:12:14 -0400 Subject: [PATCH] Don't rebuild whole image when APT_EXTRA_PACKAGES changes --- Dockerfile | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index 11e1f6e01..e124ca428 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,8 +5,6 @@ # Use the recommended Python version 3.12, as specified in the README. FROM python:3.12.11-bookworm AS comfyui-base -ARG APT_EXTRA_PACKAGES - # Install cmake, which is an indirect installation dependencies RUN apt-get update && apt-get install -y --no-install-recommends cmake @@ -72,12 +70,13 @@ VOLUME [ "/data", "/comfyui/.venv", "/comfyui/custom_nodes", "/comfyui/models", # dependencies USER root -# Install additional system dependencies -RUN apt-get install -y --no-install-recommends $APT_EXTRA_PACKAGES \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* - # Configure entrypoint RUN chmod +x entrypoint.sh ENTRYPOINT [ "./entrypoint.sh" ] CMD [ "python", "./main.py" ] + +# Install additional system dependencies +ARG APT_EXTRA_PACKAGES +RUN apt-get install -y --no-install-recommends $APT_EXTRA_PACKAGES \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/*