From e5032a07c9a76015b6996b8c21e59808ccf8e6df Mon Sep 17 00:00:00 2001 From: stoneshi-yunify Date: Fri, 31 Oct 2025 18:16:14 +0800 Subject: [PATCH 01/12] update dockerfile Signed-off-by: stoneshi-yunify --- base/Dockerfile | 5 ++ base/containers.conf | 3 + base/registries.conf | 1 + base/storage.conf | 192 +++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 201 insertions(+) create mode 100644 base/containers.conf create mode 100644 base/registries.conf create mode 100644 base/storage.conf diff --git a/base/Dockerfile b/base/Dockerfile index 8286f78..e9bbd81 100644 --- a/base/Dockerfile +++ b/base/Dockerfile @@ -42,6 +42,11 @@ RUN apt-get update && \ fuse-overlayfs \ openjdk-21-jdk +# for podman +COPY storage.conf /etc/containers/storage.conf +COPY containers.conf /etc/containers/containers.conf +COPY registries.conf /etc/containers/registries.conf + ## Settings for Java ENV JDK_HOME=/usr/lib/jvm/java-21-openjdk-${TARGETARCH} ENV JAVA_HOME=$JDK_HOME diff --git a/base/containers.conf b/base/containers.conf new file mode 100644 index 0000000..e638b65 --- /dev/null +++ b/base/containers.conf @@ -0,0 +1,3 @@ +[engine] +cgroup_manager="cgroupfs" +events_logger="file" diff --git a/base/registries.conf b/base/registries.conf new file mode 100644 index 0000000..1a76073 --- /dev/null +++ b/base/registries.conf @@ -0,0 +1 @@ +unqualified-search-registries = ["docker.io"] \ No newline at end of file diff --git a/base/storage.conf b/base/storage.conf new file mode 100644 index 0000000..b9e22af --- /dev/null +++ b/base/storage.conf @@ -0,0 +1,192 @@ +# This file is is the configuration file for all tools +# that use the containers/storage library. +# See man 5 containers-storage.conf for more information +# The "container storage" table contains all of the server options. +[storage] + +# Default Storage Driver, Must be set for proper operation. +driver = "overlay" + +# Temporary storage location +runroot = "/run/containers/storage" + +# Primary Read/Write location of container storage +graphroot = "/var/lib/containers/storage" + +# Storage path for rootless users +# +rootless_storage_path = "$HOME/.local/share/containers/storage" + +[storage.options] +# Storage options to be passed to underlying storage drivers + +# AdditionalImageStores is used to pass paths to additional Read/Only image stores +# Must be comma separated list. +additionalimagestores = [ +] + +# Remap-UIDs/GIDs is the mapping from UIDs/GIDs as they should appear inside of +# a container, to the UIDs/GIDs as they should appear outside of the container, +# and the length of the range of UIDs/GIDs. Additional mapped sets can be +# listed and will be heeded by libraries, but there are limits to the number of +# mappings which the kernel will allow when you later attempt to run a +# container. +# +# remap-uids = 0:1668442479:65536 +# remap-gids = 0:1668442479:65536 + +# Remap-User/Group is a user name which can be used to look up one or more UID/GID +# ranges in the /etc/subuid or /etc/subgid file. Mappings are set up starting +# with an in-container ID of 0 and then a host-level ID taken from the lowest +# range that matches the specified name, and using the length of that range. +# Additional ranges are then assigned, using the ranges which specify the +# lowest host-level IDs first, to the lowest not-yet-mapped in-container ID, +# until all of the entries have been used for maps. +# +# remap-user = "containers" +# remap-group = "containers" + +# Root-auto-userns-user is a user name which can be used to look up one or more UID/GID +# ranges in the /etc/subuid and /etc/subgid file. These ranges will be partitioned +# to containers configured to create automatically a user namespace. Containers +# configured to automatically create a user namespace can still overlap with containers +# having an explicit mapping set. +# This setting is ignored when running as rootless. +# root-auto-userns-user = "storage" +# +# Auto-userns-min-size is the minimum size for a user namespace created automatically. +# auto-userns-min-size=1024 +# +# Auto-userns-max-size is the minimum size for a user namespace created automatically. +# auto-userns-max-size=65536 + +[storage.options.overlay] +# ignore_chown_errors can be set to allow a non privileged user running with +# a single UID within a user namespace to run containers. The user can pull +# and use any image even those with multiple uids. Note multiple UIDs will be +# squashed down to the default uid in the container. These images will have no +# separation between the users in the container. Only supported for the overlay +# and vfs drivers. +#ignore_chown_errors = "false" + +# Path to an helper program to use for mounting the file system instead of mounting it +# directly. +mount_program = "/usr/bin/fuse-overlayfs" + +# mountopt specifies comma separated list of extra mount options +mountopt = "nodev" + +# Set to skip a PRIVATE bind mount on the storage home directory. +# skip_mount_home = "false" + +# Size is used to set a maximum size of the container image. +# size = "" + +# ForceMask specifies the permissions mask that is used for new files and +# directories. +# +# The values "shared" and "private" are accepted. +# Octal permission masks are also accepted. +# +# "": No value specified. +# All files/directories, get set with the permissions identified within the +# image. +# "private": it is equivalent to 0700. +# All files/directories get set with 0700 permissions. The owner has rwx +# access to the files. No other users on the system can access the files. +# This setting could be used with networked based homedirs. +# "shared": it is equivalent to 0755. +# The owner has rwx access to the files and everyone else can read, access +# and execute them. This setting is useful for sharing containers storage +# with other users. For instance have a storage owned by root but shared +# to rootless users as an additional store. +# NOTE: All files within the image are made readable and executable by any +# user on the system. Even /etc/shadow within your image is now readable by +# any user. +# +# OCTAL: Users can experiment with other OCTAL Permissions. +# +# Note: The force_mask Flag is an experimental feature, it could change in the +# future. When "force_mask" is set the original permission mask is stored in +# the "user.containers.override_stat" xattr and the "mount_program" option must +# be specified. Mount programs like "/usr/bin/fuse-overlayfs" present the +# extended attribute permissions to processes within containers rather then the +# "force_mask" permissions. +# +# force_mask = "" + +[storage.options.thinpool] +# Storage Options for thinpool + +# autoextend_percent determines the amount by which pool needs to be +# grown. This is specified in terms of % of pool size. So a value of 20 means +# that when threshold is hit, pool will be grown by 20% of existing +# pool size. +# autoextend_percent = "20" + +# autoextend_threshold determines the pool extension threshold in terms +# of percentage of pool size. For example, if threshold is 60, that means when +# pool is 60% full, threshold has been hit. +# autoextend_threshold = "80" + +# basesize specifies the size to use when creating the base device, which +# limits the size of images and containers. +# basesize = "10G" + +# blocksize specifies a custom blocksize to use for the thin pool. +# blocksize="64k" + +# directlvm_device specifies a custom block storage device to use for the +# thin pool. Required if you setup devicemapper. +# directlvm_device = "" + +# directlvm_device_force wipes device even if device already has a filesystem. +# directlvm_device_force = "True" + +# fs specifies the filesystem type to use for the base device. +# fs="xfs" + +# log_level sets the log level of devicemapper. +# 0: LogLevelSuppress 0 (Default) +# 2: LogLevelFatal +# 3: LogLevelErr +# 4: LogLevelWarn +# 5: LogLevelNotice +# 6: LogLevelInfo +# 7: LogLevelDebug +# log_level = "7" + +# min_free_space specifies the min free space percent in a thin pool require for +# new device creation to succeed. Valid values are from 0% - 99%. +# Value 0% disables +# min_free_space = "10%" + +# mkfsarg specifies extra mkfs arguments to be used when creating the base +# device. +# mkfsarg = "" + +# metadata_size is used to set the `pvcreate --metadatasize` options when +# creating thin devices. Default is 128k +# metadata_size = "" + +# Size is used to set a maximum size of the container image. +# size = "" + +# use_deferred_removal marks devicemapper block device for deferred removal. +# If the thinpool is in use when the driver attempts to remove it, the driver +# tells the kernel to remove it as soon as possible. Note this does not free +# up the disk space, use deferred deletion to fully remove the thinpool. +# use_deferred_removal = "True" + +# use_deferred_deletion marks thinpool device for deferred deletion. +# If the device is busy when the driver attempts to delete it, the driver +# will attempt to delete device every 30 seconds until successful. +# If the program using the driver exits, the driver will continue attempting +# to cleanup the next time the driver is used. Deferred deletion permanently +# deletes the device and all data stored in device will be lost. +# use_deferred_deletion = "True" + +# xfs_nospace_max_retries specifies the maximum number of retries XFS should +# attempt to complete IO when ENOSPC (no space) error is returned by +# underlying storage device. +# xfs_nospace_max_retries = "0" From 1b48808f1b6f82d26934f9b58d0a3c77fce6c9af Mon Sep 17 00:00:00 2001 From: yonghongshi Date: Mon, 3 Nov 2025 13:50:53 +0800 Subject: [PATCH 02/12] Update helm installation method in Dockerfile --- base/Dockerfile | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/base/Dockerfile b/base/Dockerfile index e9bbd81..4aeaf37 100644 --- a/base/Dockerfile +++ b/base/Dockerfile @@ -67,11 +67,11 @@ RUN install -m 0755 -d /etc/apt/keyrings && \ apt-get install -y docker-ce-cli docker-buildx-plugin docker-compose-plugin # Install helm -RUN curl https://baltocdn.com/helm/signing.asc | gpg --dearmor | tee /usr/share/keyrings/helm.gpg > /dev/null && \ - apt-get install apt-transport-https --yes && \ - echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/helm.gpg] https://baltocdn.com/helm/stable/debian/ all main" | tee /etc/apt/sources.list.d/helm-stable-debian.list && \ - apt-get update && \ - apt-get install -y helm +RUN sudo apt-get install curl gpg apt-transport-https --yes && \ + curl -fsSL https://packages.buildkite.com/helm-linux/helm-debian/gpgkey | gpg --dearmor | sudo tee /usr/share/keyrings/helm.gpg > /dev/null && \ + echo "deb [signed-by=/usr/share/keyrings/helm.gpg] https://packages.buildkite.com/helm-linux/helm-debian/any/ any main" | sudo tee /etc/apt/sources.list.d/helm-stable-debian.list && \ + sudo apt-get update && \ + sudo apt-get install helm # Install kubectl RUN curl -fsSL https://pkgs.k8s.io/core:/stable:/v1.32/deb/Release.key | gpg --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg && \ @@ -160,4 +160,4 @@ RUN apt-get clean && \ WORKDIR /home/jenkins # Default command -ENTRYPOINT ["/bin/bash"] \ No newline at end of file +ENTRYPOINT ["/bin/bash"] From beb89f48535c3d35f5cadc44e81538551c62c44c Mon Sep 17 00:00:00 2001 From: yonghongshi Date: Mon, 3 Nov 2025 13:52:36 +0800 Subject: [PATCH 03/12] Add -y flag to helm installation in Dockerfile --- base/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base/Dockerfile b/base/Dockerfile index 4aeaf37..55a46e3 100644 --- a/base/Dockerfile +++ b/base/Dockerfile @@ -71,7 +71,7 @@ RUN sudo apt-get install curl gpg apt-transport-https --yes && \ curl -fsSL https://packages.buildkite.com/helm-linux/helm-debian/gpgkey | gpg --dearmor | sudo tee /usr/share/keyrings/helm.gpg > /dev/null && \ echo "deb [signed-by=/usr/share/keyrings/helm.gpg] https://packages.buildkite.com/helm-linux/helm-debian/any/ any main" | sudo tee /etc/apt/sources.list.d/helm-stable-debian.list && \ sudo apt-get update && \ - sudo apt-get install helm + sudo apt-get install -y helm # Install kubectl RUN curl -fsSL https://pkgs.k8s.io/core:/stable:/v1.32/deb/Release.key | gpg --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg && \ From 6316e91f2ba64342cd2d2803d01b34aa5ceb06fc Mon Sep 17 00:00:00 2001 From: yonghongshi Date: Mon, 3 Nov 2025 15:04:09 +0800 Subject: [PATCH 04/12] Update helm installation in Dockerfile Removed 'sudo' from helm installation commands in Dockerfile. --- base/Dockerfile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/base/Dockerfile b/base/Dockerfile index 55a46e3..0c0f723 100644 --- a/base/Dockerfile +++ b/base/Dockerfile @@ -67,11 +67,11 @@ RUN install -m 0755 -d /etc/apt/keyrings && \ apt-get install -y docker-ce-cli docker-buildx-plugin docker-compose-plugin # Install helm -RUN sudo apt-get install curl gpg apt-transport-https --yes && \ - curl -fsSL https://packages.buildkite.com/helm-linux/helm-debian/gpgkey | gpg --dearmor | sudo tee /usr/share/keyrings/helm.gpg > /dev/null && \ - echo "deb [signed-by=/usr/share/keyrings/helm.gpg] https://packages.buildkite.com/helm-linux/helm-debian/any/ any main" | sudo tee /etc/apt/sources.list.d/helm-stable-debian.list && \ - sudo apt-get update && \ - sudo apt-get install -y helm +RUN apt-get install curl gpg apt-transport-https --yes && \ + curl -fsSL https://packages.buildkite.com/helm-linux/helm-debian/gpgkey | gpg --dearmor | tee /usr/share/keyrings/helm.gpg > /dev/null && \ + echo "deb [signed-by=/usr/share/keyrings/helm.gpg] https://packages.buildkite.com/helm-linux/helm-debian/any/ any main" | tee /etc/apt/sources.list.d/helm-stable-debian.list && \ + apt-get update && \ + apt-get install -y helm # Install kubectl RUN curl -fsSL https://pkgs.k8s.io/core:/stable:/v1.32/deb/Release.key | gpg --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg && \ From 44b6d6b129a9d5e41a7d8e30a472c18edac075fd Mon Sep 17 00:00:00 2001 From: yonghongshi Date: Mon, 3 Nov 2025 18:16:03 +0800 Subject: [PATCH 05/12] Clear mount_program setting in storage.conf Remove the mount program configuration. --- base/storage.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base/storage.conf b/base/storage.conf index b9e22af..70c13fd 100644 --- a/base/storage.conf +++ b/base/storage.conf @@ -71,7 +71,7 @@ additionalimagestores = [ # Path to an helper program to use for mounting the file system instead of mounting it # directly. -mount_program = "/usr/bin/fuse-overlayfs" +mount_program = "" # mountopt specifies comma separated list of extra mount options mountopt = "nodev" From 8b73e7df17afc1538b42e0784a4c990b5e684fab Mon Sep 17 00:00:00 2001 From: yonghongshi Date: Mon, 3 Nov 2025 18:16:40 +0800 Subject: [PATCH 06/12] Remove fuse-overlayfs from Dockerfile dependencies --- base/Dockerfile | 1 - 1 file changed, 1 deletion(-) diff --git a/base/Dockerfile b/base/Dockerfile index 0c0f723..04ebbd8 100644 --- a/base/Dockerfile +++ b/base/Dockerfile @@ -39,7 +39,6 @@ RUN apt-get update && \ podman \ software-properties-common \ apt-transport-https \ - fuse-overlayfs \ openjdk-21-jdk # for podman From 1e2771aa36daadb86a36b3c5b3e1ad028a5d4169 Mon Sep 17 00:00:00 2001 From: yonghongshi Date: Mon, 3 Nov 2025 18:24:27 +0800 Subject: [PATCH 07/12] Update Dockerfile --- base/Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/base/Dockerfile b/base/Dockerfile index 04ebbd8..50b3f0d 100644 --- a/base/Dockerfile +++ b/base/Dockerfile @@ -37,6 +37,7 @@ RUN apt-get update && \ python3 \ python3-pip \ podman \ + tini \ software-properties-common \ apt-transport-https \ openjdk-21-jdk @@ -159,4 +160,4 @@ RUN apt-get clean && \ WORKDIR /home/jenkins # Default command -ENTRYPOINT ["/bin/bash"] +ENTRYPOINT ["/usr/bin/tini", "--"] From 7bf0af3a201e8f3734c556ff0eeac1fb54dc7a88 Mon Sep 17 00:00:00 2001 From: yonghongshi Date: Tue, 4 Nov 2025 09:35:41 +0800 Subject: [PATCH 08/12] Update build.yaml --- .github/workflows/build.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 4a48e10..e6cdf5b 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -5,6 +5,7 @@ on: push: branches: - master + - dev tags: - 'v*.*.*' From f747e0c9274f786e82da4969f9571a04f1a9060b Mon Sep 17 00:00:00 2001 From: stoneshi-yunify Date: Tue, 4 Nov 2025 18:08:24 +0800 Subject: [PATCH 09/12] for test only Signed-off-by: stoneshi-yunify --- base/Dockerfile | 62 +++++-------------------------------------------- 1 file changed, 6 insertions(+), 56 deletions(-) diff --git a/base/Dockerfile b/base/Dockerfile index 50b3f0d..ec66dc8 100644 --- a/base/Dockerfile +++ b/base/Dockerfile @@ -38,6 +38,7 @@ RUN apt-get update && \ python3-pip \ podman \ tini \ + fuse-overlayfs \ software-properties-common \ apt-transport-https \ openjdk-21-jdk @@ -46,6 +47,7 @@ RUN apt-get update && \ COPY storage.conf /etc/containers/storage.conf COPY containers.conf /etc/containers/containers.conf COPY registries.conf /etc/containers/registries.conf +VOLUME /var/lib/containers ## Settings for Java ENV JDK_HOME=/usr/lib/jvm/java-21-openjdk-${TARGETARCH} @@ -84,65 +86,10 @@ RUN curl -fsSL https://pkgs.k8s.io/core:/stable:/v1.32/deb/Release.key | gpg --d # Install kustomize RUN cd /usr/local/bin && curl -s "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" | bash -# Install Sonar Scanner CLI -ENV SONAR_SCANNER_VERSION=7.0.2.4839 -RUN arch=$(dpkg --print-architecture) && \ - if [ $arch = "amd64" ]; then \ - TARGET_ARCH=linux-x64; \ - elif [ $arch = "arm64" ]; then \ - TARGET_ARCH=linux-aarch64; \ - else \ - echo "Unsupported architecture: $arch" && exit 1; \ - fi && \ - wget -O sonar_scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-${SONAR_SCANNER_VERSION}-${TARGET_ARCH}.zip && \ - unzip sonar_scanner.zip -d /opt && \ - rm sonar_scanner.zip && \ - mv /opt/sonar-scanner-${SONAR_SCANNER_VERSION}-${TARGET_ARCH} /opt/sonar-scanner && \ - ln -fs /opt/sonar-scanner/bin/sonar-scanner /usr/local/bin/sonar-scanner - # Install ks (Kubesphere CLI) RUN curl -fL https://github.com/kubesphere-sigs/ks/releases/download/v0.0.73/ks-linux-$(dpkg --print-architecture).tar.gz | tar xzv && \ mv ks /usr/local/bin/ -# Install golang -ENV GOVERSION=1.24 -ENV GOROOT=/usr/lib/go-${GOVERSION} -ENV GOPATH=$JENKINS_HOME/go -ENV PATH=$PATH:$GOROOT/bin:$GOPATH/bin -RUN mkdir -p $GOPATH/bin && mkdir -p $GOPATH/src && mkdir -p $GOPATH/pkg -RUN add-apt-repository -y ppa:longsleep/golang-backports && \ - apt-get update && \ - apt-get install -y golang-${GOVERSION}-go - -RUN go env -w GOPATH=$JENKINS_HOME/go - -# Install sdkman -RUN curl -s "https://get.sdkman.io" | bash - -# Install gradle -ENV GRADLE_VERSION=8.14 -RUN bash -c "source /root/.sdkman/bin/sdkman-init.sh && sdk install gradle ${GRADLE_VERSION}" - -RUN ln -fs /root/.sdkman/candidates/gradle/current/bin/gradle /usr/local/bin/gradle - -# Install Maven -ENV MAVEN_VERSION=3.9.9 -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 && \ - mv /opt/apache-maven-${MAVEN_VERSION} /opt/apache-maven -ENV M2_HOME=/opt/apache-maven -ENV maven.home=$M2_HOME -ENV M2=$M2_HOME/bin -ENV PATH=$PATH:$M2 - -# Install ant -ENV ANT_VERSION=1.10.15 -RUN wget -q https://archive.apache.org/dist/ant/binaries/apache-ant-${ANT_VERSION}-bin.tar.gz && \ - tar -xzf apache-ant-${ANT_VERSION}-bin.tar.gz && \ - mv apache-ant-${ANT_VERSION} /opt/ant && \ - rm apache-ant-${ANT_VERSION}-bin.tar.gz -ENV ANT_HOME=/opt/ant -ENV PATH=${PATH}:${ANT_HOME}/bin - # Set up NodeSource repository for Node.js RUN curl -fsSL https://deb.nodesource.com/setup_22.x | bash - @@ -150,7 +97,10 @@ RUN curl -fsSL https://deb.nodesource.com/setup_22.x | bash - RUN apt-get install -y nodejs # Install Yarn and other packages -RUN npm install --global --force yarn watch-cli typescript +RUN npm install --global --force npm@10.9.3 yarn watch-cli typescript + +# Install pnpm +RUN wget -qO- https://get.pnpm.io/install.sh | ENV="$HOME/.shrc" SHELL="$(which sh)" env PNPM_VERSION=10.17.1 sh - # Clean up RUN apt-get clean && \ From 0585cd7b84a6bc73fe30897f1f041f37bed56f56 Mon Sep 17 00:00:00 2001 From: stoneshi-yunify Date: Wed, 5 Nov 2025 09:21:33 +0800 Subject: [PATCH 10/12] for test Signed-off-by: stoneshi-yunify --- base/Dockerfile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/base/Dockerfile b/base/Dockerfile index ec66dc8..3ea6cd9 100644 --- a/base/Dockerfile +++ b/base/Dockerfile @@ -97,10 +97,13 @@ RUN curl -fsSL https://deb.nodesource.com/setup_22.x | bash - RUN apt-get install -y nodejs # Install Yarn and other packages -RUN npm install --global --force npm@10.9.3 yarn watch-cli typescript +RUN npm install --global --force corepack@latest npm@10.9.3 yarn watch-cli typescript + +# enable corepack +RUN corepack enable pnpm # Install pnpm -RUN wget -qO- https://get.pnpm.io/install.sh | ENV="$HOME/.shrc" SHELL="$(which sh)" env PNPM_VERSION=10.17.1 sh - +RUN corepack use pnpm@10.17.1 # Clean up RUN apt-get clean && \ From 5f8742e67e9992527ada0cb05657d98e989b4386 Mon Sep 17 00:00:00 2001 From: stoneshi-yunify Date: Wed, 5 Nov 2025 09:47:52 +0800 Subject: [PATCH 11/12] fix Signed-off-by: stoneshi-yunify --- base/Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/base/Dockerfile b/base/Dockerfile index 3ea6cd9..17d6806 100644 --- a/base/Dockerfile +++ b/base/Dockerfile @@ -103,7 +103,8 @@ RUN npm install --global --force corepack@latest npm@10.9.3 yarn watch-cli types RUN corepack enable pnpm # Install pnpm -RUN corepack use pnpm@10.17.1 +RUN corepack prepare pnpm@10.17.1 --activate +ENV COREPACK_ENABLE_DOWNLOADS=0 # Clean up RUN apt-get clean && \ From 539ce83d09e1d56378341c8760bdb2a63473cbc6 Mon Sep 17 00:00:00 2001 From: stoneshi-yunify Date: Wed, 5 Nov 2025 16:43:24 +0800 Subject: [PATCH 12/12] update dockerfile Signed-off-by: stoneshi-yunify --- base/Dockerfile | 68 ++++++++++++++++++++++++++++++++++++++++---- base/containers.conf | 2 ++ base/registries.conf | 24 +++++++++++++++- base/storage.conf | 3 ++ 4 files changed, 91 insertions(+), 6 deletions(-) diff --git a/base/Dockerfile b/base/Dockerfile index 17d6806..2e7ca15 100644 --- a/base/Dockerfile +++ b/base/Dockerfile @@ -37,10 +37,10 @@ RUN apt-get update && \ python3 \ python3-pip \ podman \ - tini \ - fuse-overlayfs \ software-properties-common \ apt-transport-https \ + tini \ + fuse-overlayfs \ openjdk-21-jdk # for podman @@ -86,10 +86,65 @@ RUN curl -fsSL https://pkgs.k8s.io/core:/stable:/v1.32/deb/Release.key | gpg --d # Install kustomize RUN cd /usr/local/bin && curl -s "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" | bash +# Install Sonar Scanner CLI +ENV SONAR_SCANNER_VERSION=7.0.2.4839 +RUN arch=$(dpkg --print-architecture) && \ + if [ $arch = "amd64" ]; then \ + TARGET_ARCH=linux-x64; \ + elif [ $arch = "arm64" ]; then \ + TARGET_ARCH=linux-aarch64; \ + else \ + echo "Unsupported architecture: $arch" && exit 1; \ + fi && \ + wget -O sonar_scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-${SONAR_SCANNER_VERSION}-${TARGET_ARCH}.zip && \ + unzip sonar_scanner.zip -d /opt && \ + rm sonar_scanner.zip && \ + mv /opt/sonar-scanner-${SONAR_SCANNER_VERSION}-${TARGET_ARCH} /opt/sonar-scanner && \ + ln -fs /opt/sonar-scanner/bin/sonar-scanner /usr/local/bin/sonar-scanner + # Install ks (Kubesphere CLI) RUN curl -fL https://github.com/kubesphere-sigs/ks/releases/download/v0.0.73/ks-linux-$(dpkg --print-architecture).tar.gz | tar xzv && \ mv ks /usr/local/bin/ +# Install golang +ENV GOVERSION=1.24 +ENV GOROOT=/usr/lib/go-${GOVERSION} +ENV GOPATH=$JENKINS_HOME/go +ENV PATH=$PATH:$GOROOT/bin:$GOPATH/bin +RUN mkdir -p $GOPATH/bin && mkdir -p $GOPATH/src && mkdir -p $GOPATH/pkg +RUN add-apt-repository -y ppa:longsleep/golang-backports && \ + apt-get update && \ + apt-get install -y golang-${GOVERSION}-go + +RUN go env -w GOPATH=$JENKINS_HOME/go + +# Install sdkman +RUN curl -s "https://get.sdkman.io" | bash + +# Install gradle +ENV GRADLE_VERSION=8.14 +RUN bash -c "source /root/.sdkman/bin/sdkman-init.sh && sdk install gradle ${GRADLE_VERSION}" + +RUN ln -fs /root/.sdkman/candidates/gradle/current/bin/gradle /usr/local/bin/gradle + +# Install Maven +ENV MAVEN_VERSION=3.9.9 +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 && \ + mv /opt/apache-maven-${MAVEN_VERSION} /opt/apache-maven +ENV M2_HOME=/opt/apache-maven +ENV maven.home=$M2_HOME +ENV M2=$M2_HOME/bin +ENV PATH=$PATH:$M2 + +# Install ant +ENV ANT_VERSION=1.10.15 +RUN wget -q https://archive.apache.org/dist/ant/binaries/apache-ant-${ANT_VERSION}-bin.tar.gz && \ + tar -xzf apache-ant-${ANT_VERSION}-bin.tar.gz && \ + mv apache-ant-${ANT_VERSION} /opt/ant && \ + rm apache-ant-${ANT_VERSION}-bin.tar.gz +ENV ANT_HOME=/opt/ant +ENV PATH=${PATH}:${ANT_HOME}/bin + # Set up NodeSource repository for Node.js RUN curl -fsSL https://deb.nodesource.com/setup_22.x | bash - @@ -97,14 +152,17 @@ RUN curl -fsSL https://deb.nodesource.com/setup_22.x | bash - RUN apt-get install -y nodejs # Install Yarn and other packages -RUN npm install --global --force corepack@latest npm@10.9.3 yarn watch-cli typescript +RUN npm install --global --force corepack@latest npm yarn watch-cli typescript -# enable corepack +# Enable corepack RUN corepack enable pnpm # Install pnpm -RUN corepack prepare pnpm@10.17.1 --activate +RUN corepack prepare pnpm --activate + +# Disable corepack update check ENV COREPACK_ENABLE_DOWNLOADS=0 +ENV COREPACK_DEFAULT_TO_LATEST=0 # Clean up RUN apt-get clean && \ diff --git a/base/containers.conf b/base/containers.conf index e638b65..8cbf1b6 100644 --- a/base/containers.conf +++ b/base/containers.conf @@ -1,3 +1,5 @@ +# see https://github.com/containers/common/blob/main/docs/containers.conf.5.md + [engine] cgroup_manager="cgroupfs" events_logger="file" diff --git a/base/registries.conf b/base/registries.conf index 1a76073..f3cc1c1 100644 --- a/base/registries.conf +++ b/base/registries.conf @@ -1 +1,23 @@ -unqualified-search-registries = ["docker.io"] \ No newline at end of file + +# see https://github.com/containers/image/blob/main/docs/containers-registries.conf.5.md + +unqualified-search-registries = ["docker.io"] + +# [[registry]] +# prefix = "example.com/foo" +# insecure = false +# blocked = false +# location = "internal-registry-for-example.com/bar" +# +# [[registry.mirror]] +# location = "example-mirror-0.local/mirror-for-foo" +# +# [[registry.mirror]] +# location = "example-mirror-1.local/mirrors/foo" +# insecure = true +# +# [[registry]] +# location = "registry.com" +# +# [[registry.mirror]] +# location = "mirror.registry.com" diff --git a/base/storage.conf b/base/storage.conf index 70c13fd..8c37cef 100644 --- a/base/storage.conf +++ b/base/storage.conf @@ -1,3 +1,5 @@ +# see https://github.com/containers/storage/blob/main/docs/containers-storage.conf.5.md + # This file is is the configuration file for all tools # that use the containers/storage library. # See man 5 containers-storage.conf for more information @@ -71,6 +73,7 @@ additionalimagestores = [ # Path to an helper program to use for mounting the file system instead of mounting it # directly. +# mount_program = "/usr/bin/fuse-overlayfs" mount_program = "" # mountopt specifies comma separated list of extra mount options