@@ -37,10 +37,10 @@ RUN apt-get update && \
3737 python3 \
3838 python3-pip \
3939 podman \
40- tini \
41- fuse-overlayfs \
4240 software-properties-common \
4341 apt-transport-https \
42+ tini \
43+ fuse-overlayfs \
4444 openjdk-21-jdk
4545
4646# for podman
@@ -86,25 +86,83 @@ RUN curl -fsSL https://pkgs.k8s.io/core:/stable:/v1.32/deb/Release.key | gpg --d
8686# Install kustomize
8787RUN cd /usr/local/bin && curl -s "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" | bash
8888
89+ # Install Sonar Scanner CLI
90+ ENV SONAR_SCANNER_VERSION=7.0.2.4839
91+ RUN arch=$(dpkg --print-architecture) && \
92+ if [ $arch = "amd64" ]; then \
93+ TARGET_ARCH=linux-x64; \
94+ elif [ $arch = "arm64" ]; then \
95+ TARGET_ARCH=linux-aarch64; \
96+ else \
97+ echo "Unsupported architecture: $arch" && exit 1; \
98+ fi && \
99+ wget -O sonar_scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-${SONAR_SCANNER_VERSION}-${TARGET_ARCH}.zip && \
100+ unzip sonar_scanner.zip -d /opt && \
101+ rm sonar_scanner.zip && \
102+ mv /opt/sonar-scanner-${SONAR_SCANNER_VERSION}-${TARGET_ARCH} /opt/sonar-scanner && \
103+ ln -fs /opt/sonar-scanner/bin/sonar-scanner /usr/local/bin/sonar-scanner
104+
89105# Install ks (Kubesphere CLI)
90106RUN curl -fL https://github.com/kubesphere-sigs/ks/releases/download/v0.0.73/ks-linux-$(dpkg --print-architecture).tar.gz | tar xzv && \
91107 mv ks /usr/local/bin/
92108
109+ # Install golang
110+ ENV GOVERSION=1.24
111+ ENV GOROOT=/usr/lib/go-${GOVERSION}
112+ ENV GOPATH=$JENKINS_HOME/go
113+ ENV PATH=$PATH:$GOROOT/bin:$GOPATH/bin
114+ RUN mkdir -p $GOPATH/bin && mkdir -p $GOPATH/src && mkdir -p $GOPATH/pkg
115+ RUN add-apt-repository -y ppa:longsleep/golang-backports && \
116+ apt-get update && \
117+ apt-get install -y golang-${GOVERSION}-go
118+
119+ RUN go env -w GOPATH=$JENKINS_HOME/go
120+
121+ # Install sdkman
122+ RUN curl -s "https://get.sdkman.io" | bash
123+
124+ # Install gradle
125+ ENV GRADLE_VERSION=8.14
126+ RUN bash -c "source /root/.sdkman/bin/sdkman-init.sh && sdk install gradle ${GRADLE_VERSION}"
127+
128+ RUN ln -fs /root/.sdkman/candidates/gradle/current/bin/gradle /usr/local/bin/gradle
129+
130+ # Install Maven
131+ ENV MAVEN_VERSION=3.9.9
132+ RUN curl -f -L https://archive.apache.org/dist/maven/maven-3/${MAVEN_VERSION}/binaries/apache-maven-${MAVEN_VERSION}-bin.tar.gz | tar -C /opt -xzv && \
133+ mv /opt/apache-maven-${MAVEN_VERSION} /opt/apache-maven
134+ ENV M2_HOME=/opt/apache-maven
135+ ENV maven.home=$M2_HOME
136+ ENV M2=$M2_HOME/bin
137+ ENV PATH=$PATH:$M2
138+
139+ # Install ant
140+ ENV ANT_VERSION=1.10.15
141+ RUN wget -q https://archive.apache.org/dist/ant/binaries/apache-ant-${ANT_VERSION}-bin.tar.gz && \
142+ tar -xzf apache-ant-${ANT_VERSION}-bin.tar.gz && \
143+ mv apache-ant-${ANT_VERSION} /opt/ant && \
144+ rm apache-ant-${ANT_VERSION}-bin.tar.gz
145+ ENV ANT_HOME=/opt/ant
146+ ENV PATH=${PATH}:${ANT_HOME}/bin
147+
93148# Set up NodeSource repository for Node.js
94149RUN curl -fsSL https://deb.nodesource.com/setup_22.x | bash -
95150
96151# Install Node.js
97152RUN apt-get install -y nodejs
98153
99154# Install Yarn and other packages
100- RUN npm install --global --force corepack@latest npm@10.9.3 yarn watch-cli typescript
155+ RUN npm install --global --force corepack@latest npm yarn watch-cli typescript
101156
102- # enable corepack
157+ # Enable corepack
103158RUN corepack enable pnpm
104159
105160# Install pnpm
106- RUN corepack prepare
[email protected] --activate
161+ RUN corepack prepare pnpm --activate
162+
163+ # Disable corepack update check
107164ENV COREPACK_ENABLE_DOWNLOADS=0
165+ ENV COREPACK_DEFAULT_TO_LATEST=0
108166
109167# Clean up
110168RUN apt-get clean && \
0 commit comments