build: install chktex (#5074)

Install chktex directly instead of using a third-party container image.
This commit is contained in:
Marco Ferrari 2023-12-30 16:07:07 +01:00 committed by GitHub
parent 1ca3ebccd6
commit 690d422fd6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 31 additions and 6 deletions

View file

@ -9,7 +9,6 @@
#########################################
FROM tenable/terrascan:1.18.11 as terrascan
FROM alpine/terragrunt:1.6.6 as terragrunt
FROM ghcr.io/assignuser/chktex-alpine:v0.2.0 as chktex
FROM dotenvlinter/dotenv-linter:3.3.0 as dotenv-linter
FROM ghcr.io/awkbar-devops/clang-format:v1.0.2 as clang-format
FROM ghcr.io/terraform-linters/tflint:v0.50.0 as tflint
@ -129,6 +128,14 @@ RUN apk add --no-cache --virtual .perl-build-deps \
Perl::Critic::Tics \
&& apk del --no-network --purge .perl-build-deps
##################
# Install chktex #
##################
COPY scripts/install-chktex.sh /
RUN --mount=type=secret,id=GITHUB_TOKEN /install-chktex.sh && rm -rf /install-chktex.sh
# Set work directory back to root because some scripts depend on it
WORKDIR /
######################
# Install shellcheck #
######################
@ -179,11 +186,6 @@ COPY --from=editorconfig-checker /usr/bin/ec /usr/bin/editorconfig-checker
###############################
COPY --from=dockerfile-lint /bin/hadolint /usr/bin/hadolint
##################
# Install chktex #
##################
COPY --from=chktex /usr/bin/chktex /usr/bin/
#################
# Install shfmt #
#################

23
scripts/install-chktex.sh Executable file
View file

@ -0,0 +1,23 @@
#!/usr/bin/env bash
set -euo pipefail
apk add --no-cache --virtual .chktex-build-deps \
autoconf \
automake \
gcc \
git \
libc-dev \
libtool \
make
git clone https://git.savannah.gnu.org/git/chktex.git &&
cd chktex/chktex &&
./autogen.sh --prefix=/usr/bin &&
./configure &&
make &&
install chktex /usr/bin
rm -rfv /chktex
apk del --no-network --purge .chktex-build-deps