2021-09-06 11:33:39 +00:00
|
|
|
# docker build -t clickhouse/style-test .
|
2023-08-16 21:47:46 +00:00
|
|
|
FROM ubuntu:22.04
|
2022-11-07 12:19:40 +00:00
|
|
|
ARG ACT_VERSION=0.2.33
|
|
|
|
ARG ACTIONLINT_VERSION=1.6.22
|
2020-08-14 13:09:23 +00:00
|
|
|
|
2021-11-25 16:30:39 +00:00
|
|
|
# ARG for quick switch to a given ubuntu mirror
|
|
|
|
ARG apt_archive="http://archive.ubuntu.com"
|
|
|
|
RUN sed -i "s|http://archive.ubuntu.com|$apt_archive|g" /etc/apt/sources.list
|
2021-08-23 08:22:39 +00:00
|
|
|
|
2021-02-20 19:18:49 +00:00
|
|
|
RUN apt-get update && env DEBIAN_FRONTEND=noninteractive apt-get install --yes \
|
2024-03-12 11:20:30 +00:00
|
|
|
aspell \
|
|
|
|
curl \
|
|
|
|
file \
|
2024-06-13 12:25:02 +00:00
|
|
|
gh \
|
|
|
|
git \
|
2024-03-12 11:20:30 +00:00
|
|
|
libxml2-utils \
|
2024-06-13 12:25:02 +00:00
|
|
|
locales \
|
2024-03-12 11:20:30 +00:00
|
|
|
moreutils \
|
2024-10-23 10:08:50 +00:00
|
|
|
ripgrep \
|
2024-03-12 11:20:30 +00:00
|
|
|
python3-pip \
|
|
|
|
yamllint \
|
2024-06-13 12:25:02 +00:00
|
|
|
zstd \
|
2022-07-19 11:38:30 +00:00
|
|
|
&& apt-get clean \
|
2024-03-12 11:20:30 +00:00
|
|
|
&& rm -rf /var/lib/apt/lists/* /var/cache/debconf /tmp/*
|
|
|
|
|
|
|
|
# python-magic is the same version as in Ubuntu 22.04
|
2024-07-03 19:58:18 +00:00
|
|
|
COPY requirements.txt /
|
|
|
|
RUN pip3 install --no-cache-dir -r requirements.txt
|
2023-07-30 03:20:51 +00:00
|
|
|
|
|
|
|
RUN echo "en_US.UTF-8 UTF-8" > /etc/locale.gen && locale-gen en_US.UTF-8
|
2024-10-31 18:46:35 +00:00
|
|
|
ENV LC_ALL=en_US.UTF-8
|
2020-08-14 13:09:23 +00:00
|
|
|
|
2022-01-13 20:40:21 +00:00
|
|
|
# Architecture of the image when BuildKit/buildx is used
|
|
|
|
ARG TARGETARCH
|
|
|
|
|
2024-02-29 10:29:14 +00:00
|
|
|
ARG SHELLCHECK_VERSION=0.9.0
|
|
|
|
RUN arch=${TARGETARCH:-amd64} \
|
|
|
|
&& case $arch in \
|
|
|
|
amd64) sarch=x86_64 ;; \
|
|
|
|
arm64) sarch=aarch64 ;; \
|
|
|
|
esac \
|
|
|
|
&& curl -L \
|
|
|
|
"https://github.com/koalaman/shellcheck/releases/download/v${SHELLCHECK_VERSION}/shellcheck-v${SHELLCHECK_VERSION}.linux.${sarch}.tar.xz" \
|
|
|
|
| tar xJ --strip=1 -C /tmp \
|
|
|
|
&& mv /tmp/shellcheck /usr/bin \
|
|
|
|
&& rm -rf /tmp/*
|
|
|
|
|
|
|
|
|
2022-01-13 20:40:21 +00:00
|
|
|
# Get act and actionlint from releases
|
|
|
|
RUN arch=${TARGETARCH:-amd64} \
|
|
|
|
&& case $arch in \
|
|
|
|
amd64) act_arch=x86_64 ;; \
|
|
|
|
arm64) act_arch=$arch ;; \
|
|
|
|
esac \
|
|
|
|
&& curl -o /tmp/act.tgz -L \
|
|
|
|
"https://github.com/nektos/act/releases/download/v${ACT_VERSION}/act_Linux_${act_arch}.tar.gz" \
|
|
|
|
&& tar xf /tmp/act.tgz -C /usr/bin act \
|
|
|
|
&& rm /tmp/act.tgz \
|
|
|
|
&& curl -o /tmp/actiolint.zip -L \
|
|
|
|
"https://github.com/rhysd/actionlint/releases/download/v${ACTIONLINT_VERSION}/actionlint_${ACTIONLINT_VERSION}_linux_${arch}.tar.gz" \
|
|
|
|
&& tar xf /tmp/actiolint.zip -C /usr/bin actionlint \
|
|
|
|
&& rm /tmp/actiolint.zip
|
|
|
|
|
|
|
|
|
2021-02-26 11:43:58 +00:00
|
|
|
COPY run.sh /
|
|
|
|
CMD ["/bin/bash", "/run.sh"]
|