From c5ab5c5f8015ae9ac2e2408e52a3d715736de51e Mon Sep 17 00:00:00 2001 From: Marco Ferrari Date: Fri, 16 Aug 2024 15:54:39 +0000 Subject: [PATCH] chore: reduce container image size --- Dockerfile | 49 ++++++++++++++++++---------- dependencies/python/ansible-lint.txt | 1 - dependencies/python/black.txt | 1 - dependencies/python/cfn-lint.txt | 1 - dependencies/python/checkov.txt | 1 - dependencies/python/combined.txt | 15 +++++++++ dependencies/python/cpplint.txt | 1 - dependencies/python/flake8.txt | 1 - dependencies/python/isort.txt | 1 - dependencies/python/mypy.txt | 1 - dependencies/python/pylint.txt | 1 - dependencies/python/ruff.txt | 1 - dependencies/python/snakefmt.txt | 1 - dependencies/python/snakemake.txt | 1 - dependencies/python/sqlfluff.txt | 1 - dependencies/python/yamllint.txt | 1 - dependencies/python/yq.txt | 1 - 17 files changed, 46 insertions(+), 33 deletions(-) delete mode 100644 dependencies/python/ansible-lint.txt delete mode 100644 dependencies/python/black.txt delete mode 100644 dependencies/python/cfn-lint.txt delete mode 100644 dependencies/python/checkov.txt create mode 100644 dependencies/python/combined.txt delete mode 100644 dependencies/python/cpplint.txt delete mode 100644 dependencies/python/flake8.txt delete mode 100644 dependencies/python/isort.txt delete mode 100644 dependencies/python/mypy.txt delete mode 100644 dependencies/python/pylint.txt delete mode 100644 dependencies/python/ruff.txt delete mode 100644 dependencies/python/snakefmt.txt delete mode 100644 dependencies/python/snakemake.txt delete mode 100644 dependencies/python/sqlfluff.txt delete mode 100644 dependencies/python/yamllint.txt delete mode 100644 dependencies/python/yq.txt diff --git a/Dockerfile b/Dockerfile index 7c36fc14..ac282ad4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -365,8 +365,35 @@ COPY --from=clj-kondo /bin/clj-kondo /usr/bin/ # Install dart-sdk # #################### ENV DART_SDK=/usr/lib/dart -COPY --from=dart "${DART_SDK}" "${DART_SDK}" -RUN chmod 755 "${DART_SDK}" && chmod 755 "${DART_SDK}/bin" +# These COPY directives may be compacted after --parents is supported +COPY --from=dart --chmod=0755 \ + "${DART_SDK}/version" \ + "${DART_SDK}"/ +COPY --from=dart --chmod=0755 \ + "${DART_SDK}/bin/dart" \ + "${DART_SDK}/bin/dart.sym" \ + "${DART_SDK}/bin"/ +COPY --from=dart --chmod=0755 \ + "${DART_SDK}/bin/snapshots/analysis_server.dart.snapshot" \ + "${DART_SDK}/bin/snapshots/dartdev.dart.snapshot" \ + "${DART_SDK}/bin/snapshots/frontend_server_aot.dart.snapshot" \ + "${DART_SDK}/bin/snapshots"/ +COPY --from=dart --chmod=0755 \ + "${DART_SDK}/lib/_internal" \ + "${DART_SDK}/lib/_internal" +COPY --from=dart --chmod=0755 \ + "${DART_SDK}/lib/async" \ + "${DART_SDK}/lib/async" +COPY --from=dart --chmod=0755 \ + "${DART_SDK}/lib/convert" \ + "${DART_SDK}/lib/convert" +COPY --from=dart --chmod=0755 \ + "${DART_SDK}/lib/core" \ + "${DART_SDK}/lib/core" +COPY --from=dart --chmod=0755 \ + "${DART_SDK}/lib/io" \ + "${DART_SDK}/lib/io" + ######################## # Install clang-format # @@ -396,21 +423,7 @@ COPY --from=dotenv-linter /dotenv-linter /usr/bin/ ######################### # Configure Environment # ######################### -ENV PATH="${PATH}:/venvs/ansible-lint/bin" -ENV PATH="${PATH}:/venvs/black/bin" -ENV PATH="${PATH}:/venvs/checkov/bin" -ENV PATH="${PATH}:/venvs/cfn-lint/bin" -ENV PATH="${PATH}:/venvs/cpplint/bin" -ENV PATH="${PATH}:/venvs/flake8/bin" -ENV PATH="${PATH}:/venvs/isort/bin" -ENV PATH="${PATH}:/venvs/mypy/bin" -ENV PATH="${PATH}:/venvs/pylint/bin" -ENV PATH="${PATH}:/venvs/ruff/bin" -ENV PATH="${PATH}:/venvs/snakefmt/bin" -ENV PATH="${PATH}:/venvs/snakemake/bin" -ENV PATH="${PATH}:/venvs/sqlfluff/bin" -ENV PATH="${PATH}:/venvs/yamllint/bin" -ENV PATH="${PATH}:/venvs/yq/bin" +ENV PATH="${PATH}:/venvs/combined/bin" ENV PATH="${PATH}:/node_modules/.bin" ENV PATH="${PATH}:/usr/lib/go/bin" ENV PATH="${PATH}:${DART_SDK}/bin:/root/.pub-cache/bin" @@ -474,7 +487,7 @@ ARG TARGETARCH ENV ARM_TTK_PSD1="/usr/lib/microsoft/arm-ttk/arm-ttk.psd1" ENV PATH="${PATH}:/var/cache/dotnet/tools:/usr/share/dotnet" -# Install super-linter runtime dependencies +# Install Rust linters RUN apk add --no-cache \ rust-clippy \ rustfmt diff --git a/dependencies/python/ansible-lint.txt b/dependencies/python/ansible-lint.txt deleted file mode 100644 index d42a20b8..00000000 --- a/dependencies/python/ansible-lint.txt +++ /dev/null @@ -1 +0,0 @@ -ansible-lint==24.7.0 diff --git a/dependencies/python/black.txt b/dependencies/python/black.txt deleted file mode 100644 index 6876f3ca..00000000 --- a/dependencies/python/black.txt +++ /dev/null @@ -1 +0,0 @@ -black==24.8.0 diff --git a/dependencies/python/cfn-lint.txt b/dependencies/python/cfn-lint.txt deleted file mode 100644 index a45d2d5a..00000000 --- a/dependencies/python/cfn-lint.txt +++ /dev/null @@ -1 +0,0 @@ -cfn-lint==1.9.7 diff --git a/dependencies/python/checkov.txt b/dependencies/python/checkov.txt deleted file mode 100644 index 11a761c8..00000000 --- a/dependencies/python/checkov.txt +++ /dev/null @@ -1 +0,0 @@ -checkov==3.2.220 diff --git a/dependencies/python/combined.txt b/dependencies/python/combined.txt new file mode 100644 index 00000000..a53f091c --- /dev/null +++ b/dependencies/python/combined.txt @@ -0,0 +1,15 @@ +ansible-lint==24.7.0 +black==24.8.0 +cfn-lint==1.9.7 +checkov==3.2.220 +cpplint==1.6.1 +flake8==7.1.1 +isort==5.13.2 +mypy==1.11.1 +pylint==3.2.6 +ruff==0.5.7 +snakefmt==0.10.2 +snakemake==8.2.4 +sqlfluff==3.1.0 +yamllint==1.35.1 +yq==3.4.3 diff --git a/dependencies/python/cpplint.txt b/dependencies/python/cpplint.txt deleted file mode 100644 index 87f04494..00000000 --- a/dependencies/python/cpplint.txt +++ /dev/null @@ -1 +0,0 @@ -cpplint==1.6.1 diff --git a/dependencies/python/flake8.txt b/dependencies/python/flake8.txt deleted file mode 100644 index 91fa1282..00000000 --- a/dependencies/python/flake8.txt +++ /dev/null @@ -1 +0,0 @@ -flake8==7.1.1 diff --git a/dependencies/python/isort.txt b/dependencies/python/isort.txt deleted file mode 100644 index 2abf2560..00000000 --- a/dependencies/python/isort.txt +++ /dev/null @@ -1 +0,0 @@ -isort==5.13.2 diff --git a/dependencies/python/mypy.txt b/dependencies/python/mypy.txt deleted file mode 100644 index ebb80e03..00000000 --- a/dependencies/python/mypy.txt +++ /dev/null @@ -1 +0,0 @@ -mypy==1.11.1 diff --git a/dependencies/python/pylint.txt b/dependencies/python/pylint.txt deleted file mode 100644 index 396f3515..00000000 --- a/dependencies/python/pylint.txt +++ /dev/null @@ -1 +0,0 @@ -pylint==3.2.6 diff --git a/dependencies/python/ruff.txt b/dependencies/python/ruff.txt deleted file mode 100644 index 3af089ab..00000000 --- a/dependencies/python/ruff.txt +++ /dev/null @@ -1 +0,0 @@ -ruff==0.5.7 diff --git a/dependencies/python/snakefmt.txt b/dependencies/python/snakefmt.txt deleted file mode 100644 index 43f20495..00000000 --- a/dependencies/python/snakefmt.txt +++ /dev/null @@ -1 +0,0 @@ -snakefmt==0.10.2 diff --git a/dependencies/python/snakemake.txt b/dependencies/python/snakemake.txt deleted file mode 100644 index a898f2cc..00000000 --- a/dependencies/python/snakemake.txt +++ /dev/null @@ -1 +0,0 @@ -snakemake==8.16.0 diff --git a/dependencies/python/sqlfluff.txt b/dependencies/python/sqlfluff.txt deleted file mode 100644 index b6c7e9e8..00000000 --- a/dependencies/python/sqlfluff.txt +++ /dev/null @@ -1 +0,0 @@ -sqlfluff==3.1.0 diff --git a/dependencies/python/yamllint.txt b/dependencies/python/yamllint.txt deleted file mode 100644 index 53d77b34..00000000 --- a/dependencies/python/yamllint.txt +++ /dev/null @@ -1 +0,0 @@ -yamllint==1.35.1 diff --git a/dependencies/python/yq.txt b/dependencies/python/yq.txt deleted file mode 100644 index 9787fa31..00000000 --- a/dependencies/python/yq.txt +++ /dev/null @@ -1 +0,0 @@ -yq==3.4.3