From 0e5a78d531c4443b91607c6206ec15b851be3dde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul?= Date: Sat, 30 Nov 2024 13:45:10 +0100 Subject: [PATCH 1/2] Disable pip cache when upgrading pip, etc --- Dockerfile-11.0 | 2 +- Dockerfile-12.0 | 2 +- Dockerfile-13.0 | 2 +- Dockerfile-14.0 | 2 +- Dockerfile-15.0 | 2 +- Dockerfile-16.0 | 2 +- Dockerfile-17.0 | 2 +- Dockerfile-18.0 | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Dockerfile-11.0 b/Dockerfile-11.0 index 5927c90..575bd2a 100644 --- a/Dockerfile-11.0 +++ b/Dockerfile-11.0 @@ -30,7 +30,7 @@ RUN set -x \ # isolate from system python libraries RUN set -x \ && $PYTHONBIN -m venv /odoo \ - && /odoo/bin/pip install -U pip wheel setuptools + && /odoo/bin/pip install --no-cache-dir -U pip wheel setuptools ENV PATH=/odoo/bin:$PATH ENV VIRTUAL_ENV=/odoo diff --git a/Dockerfile-12.0 b/Dockerfile-12.0 index a11e323..07b4fcc 100644 --- a/Dockerfile-12.0 +++ b/Dockerfile-12.0 @@ -29,7 +29,7 @@ RUN set -x \ # isolate from system python libraries RUN set -x \ && $PYTHONBIN -m venv /odoo \ - && /odoo/bin/pip install -U pip wheel setuptools + && /odoo/bin/pip install --no-cache-dir -U pip wheel setuptools ENV PATH=/odoo/bin:$PATH ENV VIRTUAL_ENV=/odoo diff --git a/Dockerfile-13.0 b/Dockerfile-13.0 index 80a9874..3c99591 100644 --- a/Dockerfile-13.0 +++ b/Dockerfile-13.0 @@ -29,7 +29,7 @@ RUN set -x \ # isolate from system python libraries RUN set -x \ && $PYTHONBIN -m venv /odoo \ - && /odoo/bin/pip install -U pip wheel setuptools + && /odoo/bin/pip install --no-cache-dir -U pip wheel setuptools ENV PATH=/odoo/bin:$PATH ENV VIRTUAL_ENV=/odoo diff --git a/Dockerfile-14.0 b/Dockerfile-14.0 index c4622b8..270e9e5 100644 --- a/Dockerfile-14.0 +++ b/Dockerfile-14.0 @@ -29,7 +29,7 @@ RUN set -x \ # isolate from system python libraries RUN set -x \ && $PYTHONBIN -m venv /odoo \ - && /odoo/bin/pip install -U pip wheel setuptools + && /odoo/bin/pip install --no-cache-dir -U pip wheel setuptools ENV PATH=/odoo/bin:$PATH ENV VIRTUAL_ENV=/odoo diff --git a/Dockerfile-15.0 b/Dockerfile-15.0 index 528052b..345a79f 100644 --- a/Dockerfile-15.0 +++ b/Dockerfile-15.0 @@ -29,7 +29,7 @@ RUN set -x \ # isolate from system python libraries RUN set -x \ && $PYTHONBIN -m venv /odoo \ - && /odoo/bin/pip install -U pip wheel setuptools + && /odoo/bin/pip install --no-cache-dir -U pip wheel setuptools ENV PATH=/odoo/bin:$PATH ENV VIRTUAL_ENV=/odoo diff --git a/Dockerfile-16.0 b/Dockerfile-16.0 index 698dc0e..0868f33 100644 --- a/Dockerfile-16.0 +++ b/Dockerfile-16.0 @@ -29,7 +29,7 @@ RUN set -x \ # isolate from system python libraries RUN set -x \ && $PYTHONBIN -m venv /odoo \ - && /odoo/bin/pip install -U pip wheel setuptools + && /odoo/bin/pip install --no-cache-dir -U pip wheel setuptools ENV PATH=/odoo/bin:$PATH ENV VIRTUAL_ENV=/odoo diff --git a/Dockerfile-17.0 b/Dockerfile-17.0 index 98055c2..629aef3 100644 --- a/Dockerfile-17.0 +++ b/Dockerfile-17.0 @@ -29,7 +29,7 @@ RUN set -x \ # isolate from system python libraries RUN set -x \ && $PYTHONBIN -m venv /odoo \ - && /odoo/bin/pip install -U pip wheel setuptools + && /odoo/bin/pip install --no-cache-dir -U pip wheel setuptools ENV PATH=/odoo/bin:$PATH ENV VIRTUAL_ENV=/odoo diff --git a/Dockerfile-18.0 b/Dockerfile-18.0 index 2f8d35a..cd1d72c 100644 --- a/Dockerfile-18.0 +++ b/Dockerfile-18.0 @@ -29,7 +29,7 @@ RUN set -x \ # isolate from system python libraries RUN set -x \ && $PYTHONBIN -m venv /odoo \ - && /odoo/bin/pip install -U pip + && /odoo/bin/pip install --no-cache-dir -U pip ENV PATH=/odoo/bin:$PATH ENV VIRTUAL_ENV=/odoo From 16f8c1890496885e557d710d94fe91def1a9ca50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul?= Date: Sat, 30 Nov 2024 13:50:55 +0100 Subject: [PATCH 2/2] Use bind mount to access install scripts --- Dockerfile-10.0 | 7 +++---- Dockerfile-11.0 | 7 +++---- Dockerfile-12.0 | 7 +++---- Dockerfile-13.0 | 7 +++---- Dockerfile-14.0 | 7 +++---- Dockerfile-15.0 | 7 +++---- Dockerfile-16.0 | 7 +++---- Dockerfile-17.0 | 7 +++---- Dockerfile-18.0 | 7 +++---- Dockerfile-8.0 | 7 +++---- Dockerfile-9.0 | 7 +++---- 11 files changed, 33 insertions(+), 44 deletions(-) diff --git a/Dockerfile-10.0 b/Dockerfile-10.0 index 4e6e31e..8b0a98f 100644 --- a/Dockerfile-10.0 +++ b/Dockerfile-10.0 @@ -15,8 +15,8 @@ ENV \ KWKHTMLTOPDF_SERVER_URL=http://kwkhtmltopdf -COPY ./install /tmp/install -RUN set -x \ +RUN --mount=type=bind,source=./install,target=/tmp/install \ + set -x \ && /tmp/install/pre-install.sh \ && /tmp/install/tools.sh \ && /tmp/install/gosu.sh \ @@ -24,8 +24,7 @@ RUN set -x \ && /tmp/install/lessc.sh \ && /tmp/install/wkhtmltopdf.sh \ && /tmp/install/pgdg.sh \ - && /tmp/install/post-install-clean.sh \ - && rm -r /tmp/install + && /tmp/install/post-install-clean.sh # isolate from system python libraries RUN $PYTHONBIN -m virtualenv /odoo diff --git a/Dockerfile-11.0 b/Dockerfile-11.0 index 575bd2a..dc9ac72 100644 --- a/Dockerfile-11.0 +++ b/Dockerfile-11.0 @@ -15,8 +15,8 @@ ENV \ KWKHTMLTOPDF_SERVER_URL=http://kwkhtmltopdf -COPY ./install /tmp/install -RUN set -x \ +RUN --mount=type=bind,source=./install,target=/tmp/install \ + set -x \ && /tmp/install/pre-install.sh \ && /tmp/install/tools.sh \ && /tmp/install/gosu.sh \ @@ -24,8 +24,7 @@ RUN set -x \ && /tmp/install/lessc.sh \ && /tmp/install/wkhtmltopdf.sh \ && /tmp/install/pgdg.sh \ - && /tmp/install/post-install-clean.sh \ - && rm -r /tmp/install + && /tmp/install/post-install-clean.sh # isolate from system python libraries RUN set -x \ diff --git a/Dockerfile-12.0 b/Dockerfile-12.0 index 07b4fcc..47c2a0d 100644 --- a/Dockerfile-12.0 +++ b/Dockerfile-12.0 @@ -15,16 +15,15 @@ ENV \ KWKHTMLTOPDF_SERVER_URL=http://kwkhtmltopdf -COPY ./install /tmp/install -RUN set -x \ +RUN --mount=type=bind,source=./install,target=/tmp/install \ + set -x \ && /tmp/install/pre-install.sh \ && /tmp/install/tools.sh \ && /tmp/install/gosu.sh \ && /tmp/install/python3.sh \ && /tmp/install/wkhtmltopdf.sh \ && /tmp/install/pgdg.sh \ - && /tmp/install/post-install-clean.sh \ - && rm -r /tmp/install + && /tmp/install/post-install-clean.sh # isolate from system python libraries RUN set -x \ diff --git a/Dockerfile-13.0 b/Dockerfile-13.0 index 3c99591..922330c 100644 --- a/Dockerfile-13.0 +++ b/Dockerfile-13.0 @@ -15,16 +15,15 @@ ENV \ KWKHTMLTOPDF_SERVER_URL=http://kwkhtmltopdf -COPY ./install /tmp/install -RUN set -x \ +RUN --mount=type=bind,source=./install,target=/tmp/install \ + set -x \ && /tmp/install/pre-install.sh \ && /tmp/install/tools.sh \ && /tmp/install/gosu.sh \ && /tmp/install/python3.sh \ && /tmp/install/wkhtmltopdf.sh \ && /tmp/install/pgdg.sh \ - && /tmp/install/post-install-clean.sh \ - && rm -r /tmp/install + && /tmp/install/post-install-clean.sh # isolate from system python libraries RUN set -x \ diff --git a/Dockerfile-14.0 b/Dockerfile-14.0 index 270e9e5..40bdecc 100644 --- a/Dockerfile-14.0 +++ b/Dockerfile-14.0 @@ -15,16 +15,15 @@ ENV \ KWKHTMLTOPDF_SERVER_URL=http://kwkhtmltopdf -COPY ./install /tmp/install -RUN set -x \ +RUN --mount=type=bind,source=./install,target=/tmp/install \ + set -x \ && /tmp/install/pre-install.sh \ && /tmp/install/tools.sh \ && /tmp/install/gosu.sh \ && /tmp/install/python3.sh \ && /tmp/install/wkhtmltopdf.sh \ && /tmp/install/pgdg.sh \ - && /tmp/install/post-install-clean.sh \ - && rm -r /tmp/install + && /tmp/install/post-install-clean.sh # isolate from system python libraries RUN set -x \ diff --git a/Dockerfile-15.0 b/Dockerfile-15.0 index 345a79f..439a969 100644 --- a/Dockerfile-15.0 +++ b/Dockerfile-15.0 @@ -15,16 +15,15 @@ ENV \ KWKHTMLTOPDF_SERVER_URL=http://kwkhtmltopdf -COPY ./install /tmp/install -RUN set -x \ +RUN --mount=type=bind,source=./install,target=/tmp/install \ + set -x \ && /tmp/install/pre-install.sh \ && /tmp/install/tools.sh \ && /tmp/install/gosu.sh \ && /tmp/install/python3.sh \ && /tmp/install/wkhtmltopdf.sh \ && /tmp/install/pgdg.sh \ - && /tmp/install/post-install-clean.sh \ - && rm -r /tmp/install + && /tmp/install/post-install-clean.sh # isolate from system python libraries RUN set -x \ diff --git a/Dockerfile-16.0 b/Dockerfile-16.0 index 0868f33..487a64a 100644 --- a/Dockerfile-16.0 +++ b/Dockerfile-16.0 @@ -15,16 +15,15 @@ ENV \ KWKHTMLTOPDF_SERVER_URL=http://kwkhtmltopdf -COPY ./install /tmp/install -RUN set -x \ +RUN --mount=type=bind,source=./install,target=/tmp/install \ + set -x \ && /tmp/install/pre-install.sh \ && /tmp/install/tools.sh \ && /tmp/install/gosu.sh \ && /tmp/install/python3.sh \ && /tmp/install/wkhtmltopdf.sh \ && /tmp/install/pgdg.sh \ - && /tmp/install/post-install-clean.sh \ - && rm -r /tmp/install + && /tmp/install/post-install-clean.sh # isolate from system python libraries RUN set -x \ diff --git a/Dockerfile-17.0 b/Dockerfile-17.0 index 629aef3..5d9d3ab 100644 --- a/Dockerfile-17.0 +++ b/Dockerfile-17.0 @@ -15,16 +15,15 @@ ENV \ KWKHTMLTOPDF_SERVER_URL=http://kwkhtmltopdf -COPY ./install /tmp/install -RUN set -x \ +RUN --mount=type=bind,source=./install,target=/tmp/install \ + set -x \ && /tmp/install/pre-install.sh \ && /tmp/install/tools.sh \ && /tmp/install/gosu.sh \ && /tmp/install/python3.sh \ && /tmp/install/wkhtmltopdf.sh \ && /tmp/install/pgdg.sh \ - && /tmp/install/post-install-clean.sh \ - && rm -r /tmp/install + && /tmp/install/post-install-clean.sh # isolate from system python libraries RUN set -x \ diff --git a/Dockerfile-18.0 b/Dockerfile-18.0 index cd1d72c..2ef760c 100644 --- a/Dockerfile-18.0 +++ b/Dockerfile-18.0 @@ -15,16 +15,15 @@ ENV \ KWKHTMLTOPDF_SERVER_URL=http://kwkhtmltopdf -COPY ./install /tmp/install -RUN set -x \ +RUN --mount=type=bind,source=./install,target=/tmp/install \ + set -x \ && /tmp/install/pre-install.sh \ && /tmp/install/tools.sh \ && /tmp/install/gosu.sh \ && /tmp/install/python3.sh \ && /tmp/install/wkhtmltopdf.sh \ && /tmp/install/pgdg.sh \ - && /tmp/install/post-install-clean.sh \ - && rm -r /tmp/install + && /tmp/install/post-install-clean.sh # isolate from system python libraries RUN set -x \ diff --git a/Dockerfile-8.0 b/Dockerfile-8.0 index cabda20..cba5ddf 100644 --- a/Dockerfile-8.0 +++ b/Dockerfile-8.0 @@ -14,8 +14,8 @@ ENV \ DEBIAN_FRONTEND=noninteractive \ KWKHTMLTOPDF_SERVER_URL=http://kwkhtmltopdf -COPY ./install /tmp/install -RUN set -x \ +RUN --mount=type=bind,source=./install,target=/tmp/install \ + set -x \ && /tmp/install/pre-install.sh \ && /tmp/install/tools.sh \ && /tmp/install/gosu.sh \ @@ -23,8 +23,7 @@ RUN set -x \ && /tmp/install/lessc.sh \ && /tmp/install/wkhtmltopdf.sh \ && /tmp/install/pgdg.sh \ - && /tmp/install/post-install-clean.sh \ - && rm -r /tmp/install + && /tmp/install/post-install-clean.sh # isolate from system python libraries RUN $PYTHONBIN -m virtualenv /odoo diff --git a/Dockerfile-9.0 b/Dockerfile-9.0 index f67bbee..13a4fa8 100644 --- a/Dockerfile-9.0 +++ b/Dockerfile-9.0 @@ -15,8 +15,8 @@ ENV \ KWKHTMLTOPDF_SERVER_URL=http://kwkhtmltopdf -COPY ./install /tmp/install -RUN set -x \ +RUN --mount=type=bind,source=./install,target=/tmp/install \ + set -x \ && /tmp/install/pre-install.sh \ && /tmp/install/tools.sh \ && /tmp/install/gosu.sh \ @@ -24,8 +24,7 @@ RUN set -x \ && /tmp/install/lessc.sh \ && /tmp/install/wkhtmltopdf.sh \ && /tmp/install/pgdg.sh \ - && /tmp/install/post-install-clean.sh \ - && rm -r /tmp/install + && /tmp/install/post-install-clean.sh # isolate from system python libraries RUN $PYTHONBIN -m virtualenv /odoo