From 1f2fbb14cde98f44fb4c6913769e7a2726864a1e Mon Sep 17 00:00:00 2001 From: Marco Ferrari Date: Fri, 9 Feb 2024 18:44:49 +0100 Subject: [PATCH] build: install lintr in a dedicated stage (#5247) --- Dockerfile | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 08fc01a9..9c4c0193 100644 --- a/Dockerfile +++ b/Dockerfile @@ -95,6 +95,17 @@ COPY TEMPLATES/.tflint.hcl /action/lib/.automation/ # Initialize TFLint plugins so we get plugin versions listed when we ask for TFLint version RUN tflint --init -c /action/lib/.automation/.tflint.hcl +FROM python:3.12.1-alpine3.19 as lintr-installer + +RUN apk add --no-cache \ + bash \ + R + +SHELL ["/bin/bash", "-o", "errexit", "-o", "nounset", "-o", "pipefail", "-c"] + +COPY scripts/install-lintr.sh scripts/install-r-package-or-fail.R / +RUN /install-lintr.sh && rm -rf /install-lintr.sh /install-r-package-or-fail.R + FROM python:3.12.1-alpine3.19 as base_image LABEL com.github.actions.name="Super-Linter" \ @@ -204,12 +215,6 @@ RUN --mount=type=secret,id=GITHUB_TOKEN /install-chktex.sh && rm -rf /install-ch # Set work directory back to root because some scripts depend on it WORKDIR / -################# -# Install Lintr # -################# -COPY scripts/install-lintr.sh scripts/install-r-package-or-fail.R / -RUN /install-lintr.sh && rm -rf /install-lintr.sh /install-r-package-or-fail.R - ################################# # Install luacheck and luarocks # ################################# @@ -351,6 +356,11 @@ COPY --from=clang-format /usr/bin/clang-format /usr/bin/ ######################## COPY --from=python-builder /venvs /venvs +################# +# Install Lintr # +################# +COPY --from=lintr-installer /usr/lib/R /usr/lib/R + ##################### # Install Bash-Exec # #####################