Skip to content

Commit

Permalink
Sped up the build a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
waterfoul committed Jul 24, 2023
1 parent 891a99e commit 6cf43f3
Show file tree
Hide file tree
Showing 21 changed files with 175 additions and 180 deletions.
47 changes: 20 additions & 27 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,21 @@ RUN curl --retry-all-errors --retry 10 -fLo coursier https://git.io/coursier-cli
#
# bash-exec installation
&& printf '#!/bin/bash \n\nif [[ -x "$1" ]]; then exit 0; else echo "Error: File:[$1] is not executable"; exit 1; fi' > /usr/bin/bash-exec \
&& chmod +x /usr/bin/bash-exec \
&& chmod +x /usr/bin/bash-exec

#
# pmd installation
ARG PMD_VERSION=6.55.0
RUN wget --quiet https://github.com/pmd/pmd/releases/download/pmd_releases%2F${PMD_VERSION}/pmd-bin-${PMD_VERSION}.zip && \
unzip pmd-bin-${PMD_VERSION}.zip && \
rm pmd-bin-${PMD_VERSION}.zip && \
mv pmd-bin-${PMD_VERSION} /usr/bin/pmd && \
chmod +x /usr/bin/pmd/bin/run.sh \
#
# ktlint installation
&& curl --retry 5 --retry-delay 5 -sSLO https://github.com/pinterest/ktlint/releases/latest/download/ktlint && \
chmod a+x ktlint && \
mv "ktlint" /usr/bin/ \
#
# scalafix installation
&& ./coursier install scalafix --quiet --install-dir /usr/bin && rm -rf /root/.cache
Expand Down Expand Up @@ -242,6 +256,8 @@ COPY --link --from=hadolint /bin/hadolint /usr/bin/hadolint
COPY --link --from=editorconfig-checker /usr/bin/ec /usr/bin/editorconfig-checker
COPY --link --from=dotenvlinter /dotenv-linter /usr/bin/dotenv-linter
COPY --link --from=revive /usr/bin/revive /usr/bin/revive
COPY --link --from=build-platform /usr/bin/pmd /usr/bin/pmd
COPY --link --from=build-platform /usr/bin/ktlint /usr/bin/ktlint
COPY --link --from=kubeconform /kubeconform /usr/bin/
COPY --link --from=chktex /usr/bin/chktex /usr/bin/
COPY --link --from=checkmake /checkmake /usr/bin/checkmake
Expand Down Expand Up @@ -507,7 +523,6 @@ ARG ARM_TTK_DIRECTORY='/opt/microsoft'
ARG BICEP_EXE='bicep'
ARG BICEP_DIR='/usr/local/bin'
ARG DART_VERSION='2.8.4'
ARG PMD_VERSION=6.55.0
ARG PSSA_VERSION='latest'
#ARG__END

Expand Down Expand Up @@ -566,6 +581,8 @@ RUN apk add --no-cache \
libc6-compat \
openssl \
readline-dev \
lua \
luarocks \
g++ \
libc-dev \
libgcc \
Expand Down Expand Up @@ -877,39 +894,15 @@ RUN --mount=type=secret,id=GITHUB_TOKEN CHECKSTYLE_LATEST=$(curl -s \
--output /usr/bin/checkstyle

#
# pmd installation
RUN wget --quiet https://github.com/pmd/pmd/releases/download/pmd_releases%2F${PMD_VERSION}/pmd-bin-${PMD_VERSION}.zip && \
unzip pmd-bin-${PMD_VERSION}.zip && \
rm pmd-bin-${PMD_VERSION}.zip && \
mv pmd-bin-${PMD_VERSION} /usr/bin/pmd && \
chmod +x /usr/bin/pmd/bin/run.sh \
#
# ktlint installation
&& curl --retry 5 --retry-delay 5 -sSLO https://github.com/pinterest/ktlint/releases/latest/download/ktlint && \
chmod a+x ktlint && \
mv "ktlint" /usr/bin/ \
#
# kubescape installation
&& ln -s /lib/libc.so.6 /usr/lib/libresolv.so.2 && \
RUN ln -s /lib/libc.so.6 /usr/lib/libresolv.so.2 && \
curl --retry 5 --retry-delay 5 -sLv https://raw.githubusercontent.com/kubescape/kubescape/master/install.sh | /bin/bash -s -- -v v2.3.6 \
#
# chktex installation
&& cd ~ && touch .chktexrc && cd / \
#
# luacheck installation
&& wget --tries=5 https://www.lua.org/ftp/lua-5.3.5.tar.gz -O - -q | tar -xzf - \
&& cd lua-5.3.5 \
&& make linux \
&& make install \
&& cd .. && rm -r lua-5.3.5/ \
&& wget --tries=5 https://github.com/cvega/luarocks/archive/v3.3.1-super-linter.tar.gz -O - -q | tar -xzf - \
&& cd luarocks-3.3.1-super-linter \
&& ./configure --with-lua-include=/usr/local/include \
&& make \
&& make -b install \
&& cd .. && rm -r luarocks-3.3.1-super-linter/ \
&& luarocks install luacheck \
&& cd / \
#
# perlcritic installation
&& curl --retry 5 --retry-delay 5 -sL https://cpanmin.us/ | perl - -nq --no-wget Perl::Critic
Expand Down
32 changes: 18 additions & 14 deletions flavors/cupcake/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,20 @@ FROM --platform=$BUILDPLATFORM python:3.11.3-alpine3.17 AS build-platform
RUN printf '#!/bin/bash \n\nif [[ -x "$1" ]]; then exit 0; else echo "Error: File:[$1] is not executable"; exit 1; fi' > /usr/bin/bash-exec \
&& chmod +x /usr/bin/bash-exec

#
# pmd installation
ARG PMD_VERSION=6.55.0
RUN wget --quiet https://github.com/pmd/pmd/releases/download/pmd_releases%2F${PMD_VERSION}/pmd-bin-${PMD_VERSION}.zip && \
unzip pmd-bin-${PMD_VERSION}.zip && \
rm pmd-bin-${PMD_VERSION}.zip && \
mv pmd-bin-${PMD_VERSION} /usr/bin/pmd && \
chmod +x /usr/bin/pmd/bin/run.sh \
#
# ktlint installation
&& curl --retry 5 --retry-delay 5 -sSLO https://github.com/pinterest/ktlint/releases/latest/download/ktlint && \
chmod a+x ktlint && \
mv "ktlint" /usr/bin/

#
#BUILD_PLATFORM_OTHER__END

Expand Down Expand Up @@ -216,6 +230,8 @@ COPY --link --from=hadolint /bin/hadolint /usr/bin/hadolint
COPY --link --from=editorconfig-checker /usr/bin/ec /usr/bin/editorconfig-checker
COPY --link --from=dotenvlinter /dotenv-linter /usr/bin/dotenv-linter
COPY --link --from=revive /usr/bin/revive /usr/bin/revive
COPY --link --from=build-platform /usr/bin/pmd /usr/bin/pmd
COPY --link --from=build-platform /usr/bin/ktlint /usr/bin/ktlint
COPY --link --from=kubeconform /kubeconform /usr/bin/
COPY --link --from=checkmake /checkmake /usr/bin/checkmake
COPY --link --chmod=755 --from=phpstan /composer/vendor/phpstan/phpstan/phpstan.phar /usr/bin/phpstan
Expand Down Expand Up @@ -444,7 +460,7 @@ RUN apk add --update --no-cache libc6-compat \
## @generated by .automation/build.py using descriptor files, please do not update manually ##
#############################################################################################
#ARG__START
ARG PMD_VERSION=6.55.0

#ARG__END

####################
Expand Down Expand Up @@ -661,20 +677,8 @@ RUN --mount=type=secret,id=GITHUB_TOKEN CHECKSTYLE_LATEST=$(curl -s \
--output /usr/bin/checkstyle

#
# pmd installation
RUN wget --quiet https://github.com/pmd/pmd/releases/download/pmd_releases%2F${PMD_VERSION}/pmd-bin-${PMD_VERSION}.zip && \
unzip pmd-bin-${PMD_VERSION}.zip && \
rm pmd-bin-${PMD_VERSION}.zip && \
mv pmd-bin-${PMD_VERSION} /usr/bin/pmd && \
chmod +x /usr/bin/pmd/bin/run.sh \
#
# ktlint installation
&& curl --retry 5 --retry-delay 5 -sSLO https://github.com/pinterest/ktlint/releases/latest/download/ktlint && \
chmod a+x ktlint && \
mv "ktlint" /usr/bin/ \
#
# kubescape installation
&& ln -s /lib/libc.so.6 /usr/lib/libresolv.so.2 && \
RUN ln -s /lib/libc.so.6 /usr/lib/libresolv.so.2 && \
curl --retry 5 --retry-delay 5 -sLv https://raw.githubusercontent.com/kubescape/kubescape/master/install.sh | /bin/bash -s -- -v v2.3.6

#
Expand Down
15 changes: 8 additions & 7 deletions flavors/documentation/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,12 @@ FROM --platform=$BUILDPLATFORM python:3.11.3-alpine3.17 AS build-platform
#BUILD_PLATFORM_OTHER__START
# bash-exec installation
RUN printf '#!/bin/bash \n\nif [[ -x "$1" ]]; then exit 0; else echo "Error: File:[$1] is not executable"; exit 1; fi' > /usr/bin/bash-exec \
&& chmod +x /usr/bin/bash-exec
&& chmod +x /usr/bin/bash-exec \
#
# ktlint installation
&& curl --retry 5 --retry-delay 5 -sSLO https://github.com/pinterest/ktlint/releases/latest/download/ktlint && \
chmod a+x ktlint && \
mv "ktlint" /usr/bin/

#
#BUILD_PLATFORM_OTHER__END
Expand Down Expand Up @@ -131,6 +136,7 @@ COPY --link --from=node_modules /node-deps /node-deps
COPY --link --from=hadolint /bin/hadolint /usr/bin/hadolint
COPY --link --from=editorconfig-checker /usr/bin/ec /usr/bin/editorconfig-checker
COPY --link --from=dotenvlinter /dotenv-linter /usr/bin/dotenv-linter
COPY --link --from=build-platform /usr/bin/ktlint /usr/bin/ktlint
COPY --link --from=kubeconform /kubeconform /usr/bin/
COPY --link --from=checkmake /checkmake /usr/bin/checkmake
COPY --link --from=protolint /usr/local/bin/protolint /usr/bin/
Expand Down Expand Up @@ -388,13 +394,8 @@ COPY --from=copy-collector / /
## @generated by .automation/build.py using descriptor files, please do not update manually ##
#############################################################################################
#OTHER__START
# ktlint installation
RUN curl --retry 5 --retry-delay 5 -sSLO https://github.com/pinterest/ktlint/releases/latest/download/ktlint && \
chmod a+x ktlint && \
mv "ktlint" /usr/bin/ \
#
# kubescape installation
&& ln -s /lib/libc.so.6 /usr/lib/libresolv.so.2 && \
RUN ln -s /lib/libc.so.6 /usr/lib/libresolv.so.2 && \
curl --retry 5 --retry-delay 5 -sLv https://raw.githubusercontent.com/kubescape/kubescape/master/install.sh | /bin/bash -s -- -v v2.3.6 \
#
# grype installation
Expand Down
13 changes: 7 additions & 6 deletions flavors/dotnet/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,12 @@ FROM --platform=$BUILDPLATFORM python:3.11.3-alpine3.17 AS build-platform
#BUILD_PLATFORM_OTHER__START
# bash-exec installation
RUN printf '#!/bin/bash \n\nif [[ -x "$1" ]]; then exit 0; else echo "Error: File:[$1] is not executable"; exit 1; fi' > /usr/bin/bash-exec \
&& chmod +x /usr/bin/bash-exec
&& chmod +x /usr/bin/bash-exec \
#
# ktlint installation
&& curl --retry 5 --retry-delay 5 -sSLO https://github.com/pinterest/ktlint/releases/latest/download/ktlint && \
chmod a+x ktlint && \
mv "ktlint" /usr/bin/

#
#BUILD_PLATFORM_OTHER__END
Expand Down Expand Up @@ -134,6 +139,7 @@ COPY --link --from=node_modules /node-deps /node-deps
COPY --link --from=hadolint /bin/hadolint /usr/bin/hadolint
COPY --link --from=editorconfig-checker /usr/bin/ec /usr/bin/editorconfig-checker
COPY --link --from=dotenvlinter /dotenv-linter /usr/bin/dotenv-linter
COPY --link --from=build-platform /usr/bin/ktlint /usr/bin/ktlint
COPY --link --from=kubeconform /kubeconform /usr/bin/
COPY --link --from=checkmake /checkmake /usr/bin/checkmake
COPY --link --from=protolint /usr/local/bin/protolint /usr/bin/
Expand Down Expand Up @@ -485,11 +491,6 @@ esac \
# csharpier installation
&& /usr/share/dotnet/dotnet tool install -g csharpier \
#
# ktlint installation
&& curl --retry 5 --retry-delay 5 -sSLO https://github.com/pinterest/ktlint/releases/latest/download/ktlint && \
chmod a+x ktlint && \
mv "ktlint" /usr/bin/ \
#
# kubescape installation
&& ln -s /lib/libc.so.6 /usr/lib/libresolv.so.2 && \
curl --retry 5 --retry-delay 5 -sLv https://raw.githubusercontent.com/kubescape/kubescape/master/install.sh | /bin/bash -s -- -v v2.3.6 \
Expand Down
13 changes: 7 additions & 6 deletions flavors/dotnetweb/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,12 @@ FROM --platform=$BUILDPLATFORM python:3.11.3-alpine3.17 AS build-platform
#BUILD_PLATFORM_OTHER__START
# bash-exec installation
RUN printf '#!/bin/bash \n\nif [[ -x "$1" ]]; then exit 0; else echo "Error: File:[$1] is not executable"; exit 1; fi' > /usr/bin/bash-exec \
&& chmod +x /usr/bin/bash-exec
&& chmod +x /usr/bin/bash-exec \
#
# ktlint installation
&& curl --retry 5 --retry-delay 5 -sSLO https://github.com/pinterest/ktlint/releases/latest/download/ktlint && \
chmod a+x ktlint && \
mv "ktlint" /usr/bin/

#
#BUILD_PLATFORM_OTHER__END
Expand Down Expand Up @@ -154,6 +159,7 @@ COPY --link --from=shfmt /bin/shfmt /usr/bin/
COPY --link --from=hadolint /bin/hadolint /usr/bin/hadolint
COPY --link --from=editorconfig-checker /usr/bin/ec /usr/bin/editorconfig-checker
COPY --link --from=dotenvlinter /dotenv-linter /usr/bin/dotenv-linter
COPY --link --from=build-platform /usr/bin/ktlint /usr/bin/ktlint
COPY --link --from=kubeconform /kubeconform /usr/bin/
COPY --link --from=checkmake /checkmake /usr/bin/checkmake
COPY --link --from=protolint /usr/local/bin/protolint /usr/bin/
Expand Down Expand Up @@ -505,11 +511,6 @@ esac \
# csharpier installation
&& /usr/share/dotnet/dotnet tool install -g csharpier \
#
# ktlint installation
&& curl --retry 5 --retry-delay 5 -sSLO https://github.com/pinterest/ktlint/releases/latest/download/ktlint && \
chmod a+x ktlint && \
mv "ktlint" /usr/bin/ \
#
# kubescape installation
&& ln -s /lib/libc.so.6 /usr/lib/libresolv.so.2 && \
curl --retry 5 --retry-delay 5 -sLv https://raw.githubusercontent.com/kubescape/kubescape/master/install.sh | /bin/bash -s -- -v v2.3.6 \
Expand Down
13 changes: 7 additions & 6 deletions flavors/go/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,12 @@ FROM --platform=$BUILDPLATFORM python:3.11.3-alpine3.17 AS build-platform
#BUILD_PLATFORM_OTHER__START
# bash-exec installation
RUN printf '#!/bin/bash \n\nif [[ -x "$1" ]]; then exit 0; else echo "Error: File:[$1] is not executable"; exit 1; fi' > /usr/bin/bash-exec \
&& chmod +x /usr/bin/bash-exec
&& chmod +x /usr/bin/bash-exec \
#
# ktlint installation
&& curl --retry 5 --retry-delay 5 -sSLO https://github.com/pinterest/ktlint/releases/latest/download/ktlint && \
chmod a+x ktlint && \
mv "ktlint" /usr/bin/

#
#BUILD_PLATFORM_OTHER__END
Expand Down Expand Up @@ -146,6 +151,7 @@ COPY --link --from=hadolint /bin/hadolint /usr/bin/hadolint
COPY --link --from=editorconfig-checker /usr/bin/ec /usr/bin/editorconfig-checker
COPY --link --from=dotenvlinter /dotenv-linter /usr/bin/dotenv-linter
COPY --link --from=revive /usr/bin/revive /usr/bin/revive
COPY --link --from=build-platform /usr/bin/ktlint /usr/bin/ktlint
COPY --link --from=kubeconform /kubeconform /usr/bin/
COPY --link --from=checkmake /checkmake /usr/bin/checkmake
COPY --link --from=protolint /usr/local/bin/protolint /usr/bin/
Expand Down Expand Up @@ -408,11 +414,6 @@ COPY --from=copy-collector / /
RUN wget -O- -nv https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh \
&& golangci-lint --version \
#
# ktlint installation
&& curl --retry 5 --retry-delay 5 -sSLO https://github.com/pinterest/ktlint/releases/latest/download/ktlint && \
chmod a+x ktlint && \
mv "ktlint" /usr/bin/ \
#
# kubescape installation
&& ln -s /lib/libc.so.6 /usr/lib/libresolv.so.2 && \
curl --retry 5 --retry-delay 5 -sLv https://raw.githubusercontent.com/kubescape/kubescape/master/install.sh | /bin/bash -s -- -v v2.3.6 \
Expand Down
32 changes: 18 additions & 14 deletions flavors/java/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,20 @@ FROM --platform=$BUILDPLATFORM python:3.11.3-alpine3.17 AS build-platform
RUN printf '#!/bin/bash \n\nif [[ -x "$1" ]]; then exit 0; else echo "Error: File:[$1] is not executable"; exit 1; fi' > /usr/bin/bash-exec \
&& chmod +x /usr/bin/bash-exec

#
# pmd installation
ARG PMD_VERSION=6.55.0
RUN wget --quiet https://github.com/pmd/pmd/releases/download/pmd_releases%2F${PMD_VERSION}/pmd-bin-${PMD_VERSION}.zip && \
unzip pmd-bin-${PMD_VERSION}.zip && \
rm pmd-bin-${PMD_VERSION}.zip && \
mv pmd-bin-${PMD_VERSION} /usr/bin/pmd && \
chmod +x /usr/bin/pmd/bin/run.sh \
#
# ktlint installation
&& curl --retry 5 --retry-delay 5 -sSLO https://github.com/pinterest/ktlint/releases/latest/download/ktlint && \
chmod a+x ktlint && \
mv "ktlint" /usr/bin/

#
#BUILD_PLATFORM_OTHER__END

Expand Down Expand Up @@ -131,6 +145,8 @@ COPY --link --from=node_modules /node-deps /node-deps
COPY --link --from=hadolint /bin/hadolint /usr/bin/hadolint
COPY --link --from=editorconfig-checker /usr/bin/ec /usr/bin/editorconfig-checker
COPY --link --from=dotenvlinter /dotenv-linter /usr/bin/dotenv-linter
COPY --link --from=build-platform /usr/bin/pmd /usr/bin/pmd
COPY --link --from=build-platform /usr/bin/ktlint /usr/bin/ktlint
COPY --link --from=kubeconform /kubeconform /usr/bin/
COPY --link --from=checkmake /checkmake /usr/bin/checkmake
COPY --link --from=protolint /usr/local/bin/protolint /usr/bin/
Expand Down Expand Up @@ -287,7 +303,7 @@ RUN apk add --update --no-cache libc6-compat \
## @generated by .automation/build.py using descriptor files, please do not update manually ##
#############################################################################################
#ARG__START
ARG PMD_VERSION=6.55.0

#ARG__END

####################
Expand Down Expand Up @@ -458,20 +474,8 @@ RUN --mount=type=secret,id=GITHUB_TOKEN CHECKSTYLE_LATEST=$(curl -s \
--output /usr/bin/checkstyle

#
# pmd installation
RUN wget --quiet https://github.com/pmd/pmd/releases/download/pmd_releases%2F${PMD_VERSION}/pmd-bin-${PMD_VERSION}.zip && \
unzip pmd-bin-${PMD_VERSION}.zip && \
rm pmd-bin-${PMD_VERSION}.zip && \
mv pmd-bin-${PMD_VERSION} /usr/bin/pmd && \
chmod +x /usr/bin/pmd/bin/run.sh \
#
# ktlint installation
&& curl --retry 5 --retry-delay 5 -sSLO https://github.com/pinterest/ktlint/releases/latest/download/ktlint && \
chmod a+x ktlint && \
mv "ktlint" /usr/bin/ \
#
# kubescape installation
&& ln -s /lib/libc.so.6 /usr/lib/libresolv.so.2 && \
RUN ln -s /lib/libc.so.6 /usr/lib/libresolv.so.2 && \
curl --retry 5 --retry-delay 5 -sLv https://raw.githubusercontent.com/kubescape/kubescape/master/install.sh | /bin/bash -s -- -v v2.3.6 \
#
# grype installation
Expand Down
15 changes: 8 additions & 7 deletions flavors/javascript/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,12 @@ FROM --platform=$BUILDPLATFORM python:3.11.3-alpine3.17 AS build-platform
#BUILD_PLATFORM_OTHER__START
# bash-exec installation
RUN printf '#!/bin/bash \n\nif [[ -x "$1" ]]; then exit 0; else echo "Error: File:[$1] is not executable"; exit 1; fi' > /usr/bin/bash-exec \
&& chmod +x /usr/bin/bash-exec
&& chmod +x /usr/bin/bash-exec \
#
# ktlint installation
&& curl --retry 5 --retry-delay 5 -sSLO https://github.com/pinterest/ktlint/releases/latest/download/ktlint && \
chmod a+x ktlint && \
mv "ktlint" /usr/bin/

#
#BUILD_PLATFORM_OTHER__END
Expand Down Expand Up @@ -152,6 +157,7 @@ COPY --link --from=shfmt /bin/shfmt /usr/bin/
COPY --link --from=hadolint /bin/hadolint /usr/bin/hadolint
COPY --link --from=editorconfig-checker /usr/bin/ec /usr/bin/editorconfig-checker
COPY --link --from=dotenvlinter /dotenv-linter /usr/bin/dotenv-linter
COPY --link --from=build-platform /usr/bin/ktlint /usr/bin/ktlint
COPY --link --from=kubeconform /kubeconform /usr/bin/
COPY --link --from=protolint /usr/local/bin/protolint /usr/bin/
COPY --link --from=gitleaks /usr/bin/gitleaks /usr/bin/
Expand Down Expand Up @@ -408,13 +414,8 @@ COPY --from=copy-collector / /
## @generated by .automation/build.py using descriptor files, please do not update manually ##
#############################################################################################
#OTHER__START
# ktlint installation
RUN curl --retry 5 --retry-delay 5 -sSLO https://github.com/pinterest/ktlint/releases/latest/download/ktlint && \
chmod a+x ktlint && \
mv "ktlint" /usr/bin/ \
#
# kubescape installation
&& ln -s /lib/libc.so.6 /usr/lib/libresolv.so.2 && \
RUN ln -s /lib/libc.so.6 /usr/lib/libresolv.so.2 && \
curl --retry 5 --retry-delay 5 -sLv https://raw.githubusercontent.com/kubescape/kubescape/master/install.sh | /bin/bash -s -- -v v2.3.6 \
#
# grype installation
Expand Down
Loading

0 comments on commit 6cf43f3

Please sign in to comment.