File size: 2,652 Bytes
e63bddb
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
FROM swr.cn-north-4.myhuaweicloud.com/ddn-k8s/ghcr.io/realm/swiftlint:0.59.1

ENV USER=root
ENV HOME=/root
WORKDIR $HOME

ARG DEBIAN_FRONTEND=noninteractive
RUN cat /proc/version \
# RUN echo 'deb http://mirrors.tecent.com/debian bullseye main contrib non-free\n\
# deb http://mirrors.tecent.com/debian-security bullseye-security main contrib non-free\n\
# deb http://mirrors.tecent.com/debian bullseye-updates main contrib non-free' > /etc/apt/sources.list
 && apt-get update \
 && apt-get install -y python3 python3-pip python-is-python3 npm php-cli shellcheck rubocop cppcheck clang-tidy mono-complete unzip wget curl git \
 && apt-get clean \
 && rm -rf /var/lib/apt/lists/*
RUN pip3 install uv --break-system-packages -i https://mirrors.cloud.tencent.com/pypi/simple
RUN uv venv
RUN . /root/.venv/bin/activate
RUN uv pip install ruff sqlfluff pyarrow pandas tqdm -i https://mirrors.cloud.tencent.com/pypi/simple
RUN wget https://github.com/pmd/pmd/releases/download/pmd_releases%2F7.14.0/pmd-dist-7.14.0-bin.zip && \
    unzip pmd-dist-7.14.0-bin.zip -d /opt && \
    ln -s /opt/pmd-bin-7.14.0/bin/pmd /usr/local/bin/pmd
RUN wget https://github.com/phpstan/phpstan/releases/latest/download/phpstan.phar && \
    chmod +x phpstan.phar && mv phpstan.phar /usr/local/bin/phpstan
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y && \
    /root/.cargo/bin/rustup component add clippy && \
    ln -s /root/.cargo/bin/clippy-driver /usr/local/bin/clippy-driver
RUN wget https://go.dev/dl/go1.23.10.linux-amd64.tar.gz && \
    tar -C /usr/local -xzf go1.23.10.linux-amd64.tar.gz && \
    /usr/local/go/bin/go install honnef.co/go/tools/cmd/staticcheck@latest && \
    /usr/local/go/bin/go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest && \
    ln -s /root/go/bin/staticcheck /usr/local/bin/staticcheck && \
    ln -s /root/go/bin/golangci-lint /usr/local/bin/golangci-lint
RUN npm install -g eslint
RUN apt-get update
RUN apt-get install -y openjdk-11-jdk
ENV PATH=/root/.venv/bin/ruff:$PATH:/root/.cargo/bin:/usr/local/go/bin

RUN echo "===== 工具版本检查 =====" && \
    python3 --version && \
    pip3 --version && \
    ruff --version && \
    sqlfluff --version && \
    cppcheck --version && \
    clang-tidy --version && \
    php --version && \
    phpstan --version || true && \
    pmd --version && \
    rustc --version && \
    clippy-driver --version && \
    go version && \
    staticcheck --version && \
    golangci-lint --version && \
    eslint --version && \
    shellcheck --version && \
    rubocop --version && \
    mcs --version && \
    swiftlint version

ENV LANG='en_US.UTF-8'
ENV LANGUAGE='en_US:en'