Skip to content

Commit

Permalink
Support arm64
Browse files Browse the repository at this point in the history
  • Loading branch information
harryzcy committed Feb 26, 2024
1 parent 52b082b commit b287234
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 47 deletions.
44 changes: 22 additions & 22 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -327,10 +327,10 @@ COPY --from=shfmt /bin/shfmt /usr/bin/
####################
COPY --from=gitleaks /usr/bin/gitleaks /usr/bin/

####################
# Install scalafmt #
####################
COPY --from=scalafmt /bin/scalafmt /usr/bin/
# ####################
# # Install scalafmt #
# ####################
# COPY --from=scalafmt /bin/scalafmt /usr/bin/

######################
# Install actionlint #
Expand All @@ -342,10 +342,10 @@ COPY --from=actionlint /usr/local/bin/actionlint /usr/bin/
######################
COPY --from=kubeconfrm /kubeconform /usr/bin/

#####################
# Install clj-kondo #
#####################
COPY --from=clj-kondo /bin/clj-kondo /usr/bin/
# #####################
# # Install clj-kondo #
# #####################
# COPY --from=clj-kondo /bin/clj-kondo /usr/bin/

####################
# Install dart-sdk #
Expand Down Expand Up @@ -464,20 +464,20 @@ COPY --from=dotnet-sdk /usr/share/dotnet /usr/share/dotnet
# Trigger first run experience by running arbitrary cmd
RUN dotnet help

#########################################
# Install Powershell + PSScriptAnalyzer #
#########################################
COPY --from=powershell-installer /tmp/PS_INSTALL_FOLDER /tmp/PS_INSTALL_FOLDER
COPY --from=powershell /opt/microsoft/powershell /opt/microsoft/powershell
# Disable Powershell telemetry
ENV POWERSHELL_TELEMETRY_OPTOUT=1
ARG PSSA_VERSION='1.21.0'
RUN PS_INSTALL_FOLDER="$(cat /tmp/PS_INSTALL_FOLDER)" \
&& echo "PS_INSTALL_FOLDER: ${PS_INSTALL_FOLDER}" \
&& ln -s "${PS_INSTALL_FOLDER}/pwsh" /usr/bin/pwsh \
&& chmod a+x,o-w "${PS_INSTALL_FOLDER}/pwsh" \
&& pwsh -c "Install-Module -Name PSScriptAnalyzer -RequiredVersion ${PSSA_VERSION} -Scope AllUsers -Force" \
&& rm -rf /tmp/PS_INSTALL_FOLDER
# #########################################
# # Install Powershell + PSScriptAnalyzer #
# #########################################
# COPY --from=powershell-installer /tmp/PS_INSTALL_FOLDER /tmp/PS_INSTALL_FOLDER
# COPY --from=powershell /opt/microsoft/powershell /opt/microsoft/powershell
# # Disable Powershell telemetry
# ENV POWERSHELL_TELEMETRY_OPTOUT=1
# ARG PSSA_VERSION='1.21.0'
# RUN PS_INSTALL_FOLDER="$(cat /tmp/PS_INSTALL_FOLDER)" \
# && echo "PS_INSTALL_FOLDER: ${PS_INSTALL_FOLDER}" \
# && ln -s "${PS_INSTALL_FOLDER}/pwsh" /usr/bin/pwsh \
# && chmod a+x,o-w "${PS_INSTALL_FOLDER}/pwsh" \
# && pwsh -c "Install-Module -Name PSScriptAnalyzer -RequiredVersion ${PSSA_VERSION} -Scope AllUsers -Force" \
# && rm -rf /tmp/PS_INSTALL_FOLDER

#############################################################
# Install Azure Resource Manager Template Toolkit (arm-ttk) #
Expand Down
10 changes: 10 additions & 0 deletions dependencies/python/build-venvs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@
#####################
set -euo pipefail

# libffi-dev is required for building wheel for cffi
apk add --no-cache --virtual .python-build-deps \
gcc \
libffi-dev \
linux-headers \
musl-dev \
python3-dev
Expand All @@ -24,6 +26,14 @@ mkdir -p /venvs
########################################
pip install virtualenv

########################################################
# Install Rust compiler (required by checkov on arm64) #
########################################################
# remove this once https://github.com/bridgecrewio/checkov/pull/6045 is merged
apk add --no-cache curl
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
export PATH=$PATH:$HOME/.cargo/bin

#######################################################
# Iterate through requirments.txt to install binaries #
#######################################################
Expand Down
20 changes: 1 addition & 19 deletions scripts/install-glibc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,6 @@

set -euo pipefail

case $TARGETARCH in
amd64)
target=x86_64
;;
arm64)
target=arm64
;;
*)
echo "$TARGETARCH is not supported"
exit 1
;;
esac

url=$(
set -euo pipefail
curl -s \
Expand All @@ -31,14 +18,9 @@ apk add --no-cache --force-overwrite "glibc-${GLIBC_VERSION}.apk"
rm "glibc-${GLIBC_VERSION}.apk"

# Install zlib
mkdir /tmp/libz

apk add --no-cache --virtual .glibc-build-deps \
tar \
zlib \
zstd

curl --retry 5 --retry-delay 5 -sL https://www.archlinux.org/packages/core/${target}/zlib/download | tar -x --zstd -C /tmp/libz
mv /tmp/libz/usr/lib/libz.so* /usr/glibc-compat/lib
rm -rf /tmp/libz

apk del --no-network --purge .glibc-build-deps
12 changes: 6 additions & 6 deletions scripts/linterVersions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ set -o pipefail
declare -A LINTER_NAMES_ARRAY
LINTER_NAMES_ARRAY['ANSIBLE']="ansible-lint"
LINTER_NAMES_ARRAY['BASH']="shellcheck"
LINTER_NAMES_ARRAY['BASH_EXEC']="bash-exec"
# LINTER_NAMES_ARRAY['BASH_EXEC']="bash-exec"
LINTER_NAMES_ARRAY['CHECKOV']="checkov"
LINTER_NAMES_ARRAY['CLANG_FORMAT']="clang-format"
LINTER_NAMES_ARRAY['CLOJURE']="clj-kondo"
# LINTER_NAMES_ARRAY['CLOJURE']="clj-kondo"
LINTER_NAMES_ARRAY['CLOUDFORMATION']="cfn-lint"
LINTER_NAMES_ARRAY['COFFEESCRIPT']="coffeelint"
LINTER_NAMES_ARRAY['CPP']="cpplint"
LINTER_NAMES_ARRAY['CSS']="stylelint"
LINTER_NAMES_ARRAY['DART']="dart"
# LINTER_NAMES_ARRAY['DART']="dart"
LINTER_NAMES_ARRAY['DOCKERFILE_HADOLINT']="hadolint"
LINTER_NAMES_ARRAY['EDITORCONFIG']="editorconfig-checker"
LINTER_NAMES_ARRAY['GITHUB_ACTIONS']="actionlint"
Expand Down Expand Up @@ -59,7 +59,7 @@ LINTER_NAMES_ARRAY['R']="R"
LINTER_NAMES_ARRAY['RAKU']="raku"
LINTER_NAMES_ARRAY['RENOVATE']="renovate-config-validator"
LINTER_NAMES_ARRAY['RUBY']="rubocop"
LINTER_NAMES_ARRAY['SCALAFMT']="scalafmt"
# LINTER_NAMES_ARRAY['SCALAFMT']="scalafmt"
LINTER_NAMES_ARRAY['SHELL_SHFMT']="shfmt"
LINTER_NAMES_ARRAY['SNAKEMAKE_LINT']="snakemake"
LINTER_NAMES_ARRAY['SNAKEMAKE_SNAKEFMT']="snakefmt"
Expand All @@ -81,8 +81,8 @@ LINTER_NAMES_ARRAY['YAML']="yamllint"
if [[ "${IMAGE}" == "standard" ]]; then
LINTER_NAMES_ARRAY['ARM']="arm-ttk"
LINTER_NAMES_ARRAY['CSHARP']="dotnet"
LINTER_NAMES_ARRAY['ENV']="dotenv-linter"
LINTER_NAMES_ARRAY['POWERSHELL']="pwsh"
# LINTER_NAMES_ARRAY['ENV']="dotenv-linter"
# LINTER_NAMES_ARRAY['POWERSHELL']="pwsh"
LINTER_NAMES_ARRAY['RUST_2015']="rustfmt"
LINTER_NAMES_ARRAY['RUST_2018']="rustfmt"
LINTER_NAMES_ARRAY['RUST_2021']="rustfmt"
Expand Down

0 comments on commit b287234

Please sign in to comment.