Skip to content

Commit 539ce83

Browse files
update dockerfile
Signed-off-by: stoneshi-yunify <[email protected]>
1 parent 5f8742e commit 539ce83

File tree

4 files changed

+91
-6
lines changed

4 files changed

+91
-6
lines changed

base/Dockerfile

Lines changed: 63 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -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
8787
RUN 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)
90106
RUN 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
94149
RUN curl -fsSL https://deb.nodesource.com/setup_22.x | bash -
95150

96151
# Install Node.js
97152
RUN 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
103158
RUN 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
107164
ENV COREPACK_ENABLE_DOWNLOADS=0
165+
ENV COREPACK_DEFAULT_TO_LATEST=0
108166

109167
# Clean up
110168
RUN apt-get clean && \

base/containers.conf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# see https://github.com/containers/common/blob/main/docs/containers.conf.5.md
2+
13
[engine]
24
cgroup_manager="cgroupfs"
35
events_logger="file"

base/registries.conf

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,23 @@
1-
unqualified-search-registries = ["docker.io"]
1+
2+
# see https://github.com/containers/image/blob/main/docs/containers-registries.conf.5.md
3+
4+
unqualified-search-registries = ["docker.io"]
5+
6+
# [[registry]]
7+
# prefix = "example.com/foo"
8+
# insecure = false
9+
# blocked = false
10+
# location = "internal-registry-for-example.com/bar"
11+
#
12+
# [[registry.mirror]]
13+
# location = "example-mirror-0.local/mirror-for-foo"
14+
#
15+
# [[registry.mirror]]
16+
# location = "example-mirror-1.local/mirrors/foo"
17+
# insecure = true
18+
#
19+
# [[registry]]
20+
# location = "registry.com"
21+
#
22+
# [[registry.mirror]]
23+
# location = "mirror.registry.com"

base/storage.conf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# see https://github.com/containers/storage/blob/main/docs/containers-storage.conf.5.md
2+
13
# This file is is the configuration file for all tools
24
# that use the containers/storage library.
35
# See man 5 containers-storage.conf for more information
@@ -71,6 +73,7 @@ additionalimagestores = [
7173

7274
# Path to an helper program to use for mounting the file system instead of mounting it
7375
# directly.
76+
# mount_program = "/usr/bin/fuse-overlayfs"
7477
mount_program = ""
7578

7679
# mountopt specifies comma separated list of extra mount options

0 commit comments

Comments
 (0)