From 6111c2985f0afc23abd1171babc89e113427199d Mon Sep 17 00:00:00 2001 From: Rick <1450685+LinuxSuRen@users.noreply.github.com> Date: Tue, 8 Mar 2022 13:59:01 +0800 Subject: [PATCH 01/59] Install ks cli into the base image (#66) * Install ks cli into the base image * fix the wrong usage of curl download file --- base/hack/install_utils.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/base/hack/install_utils.sh b/base/hack/install_utils.sh index 0591535..3963a41 100755 --- a/base/hack/install_utils.sh +++ b/base/hack/install_utils.sh @@ -65,3 +65,17 @@ else echo "do not support this arch" exit 1 fi + +# ks + +if [[ ${ARCH} == 'x86_64' ]]; then + curl -fL https://github.com/kubesphere-sigs/ks/releases/download/v0.0.62/ks-linux-amd64.tar.gz | tar xzv && \ + mv ks /usr/bin/ +elif [[ ${ARCH} == 'aarch64' ]] +then + curl -fL https://github.com/kubesphere-sigs/ks/releases/download/v0.0.62/ks-linux-arm64.tar.gz | tar xzv && \ + mv ks /usr/bin/ +else + echo "do not support this arch" + exit 1 +fi From d4fcde2e31aee45fd3a64bd33f163dcf6c6f3730 Mon Sep 17 00:00:00 2001 From: Rick <1450685+LinuxSuRen@users.noreply.github.com> Date: Mon, 28 Mar 2022 17:25:05 +0800 Subject: [PATCH 02/59] Add kustomize command to the base image (#67) --- base/hack/install_utils.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/base/hack/install_utils.sh b/base/hack/install_utils.sh index 3963a41..1ab819b 100755 --- a/base/hack/install_utils.sh +++ b/base/hack/install_utils.sh @@ -79,3 +79,17 @@ else echo "do not support this arch" exit 1 fi + +# kustomize +KUSTOMIZE_VERSION=4.5.3 +if [[ ${ARCH} == 'x86_64' ]]; then + curl -fL https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize%2Fv${KUSTOMIZE_VERSION}/kustomize_v${KUSTOMIZE_VERSION}_linux_amd64.tar.gz | tar xzv && \ + mv kustomize /usr/bin/ +elif [[ ${ARCH} == 'aarch64' ]] +then + curl -fL https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize%2Fv${KUSTOMIZE_VERSION}/kustomize_v${KUSTOMIZE_VERSION}_linux_arm64.tar.gz | tar xzv && \ + mv kustomize /usr/bin/ +else + echo "do not support this arch" + exit 1 +fi From 3cd819c483973f49416023aaa1df4dbabe91a444 Mon Sep 17 00:00:00 2001 From: Rick <1450685+LinuxSuRen@users.noreply.github.com> Date: Fri, 1 Apr 2022 10:06:34 +0800 Subject: [PATCH 03/59] Fix the podman command alias (#68) it would be better to set the command alias as a global one instead of a particular user --- base/podman/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base/podman/Dockerfile b/base/podman/Dockerfile index affe2f1..8934da6 100644 --- a/base/podman/Dockerfile +++ b/base/podman/Dockerfile @@ -59,7 +59,7 @@ RUN ./hack/install_utils.sh && rm -rf ./* # Install podman RUN curl -L -o /etc/yum.repos.d/devel:kubic:libcontainers:stable.repo https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/CentOS_7/devel:kubic:libcontainers:stable.repo && \ yum -y install podman fuse-overlayfs && \ - echo "alias docker=podman" >> /root/.bashrc && \ + ln -s /usr/bin/podman /usr/bin/docker && \ yum -y clean all --enablerepo='*' COPY storage.conf /etc/containers/storage.conf From 151d2777f8be79c3155cc2eff8a52e57faeefe81 Mon Sep 17 00:00:00 2001 From: Rick <1450685+LinuxSuRen@users.noreply.github.com> Date: Sat, 2 Apr 2022 08:17:21 +0800 Subject: [PATCH 04/59] Bump ks command from v0.0.62 to v0.0.63 (#69) * Bump ks command from v0.0.62 to v0.0.63 * Bump ks command to v0.0.64 --- base/hack/install_utils.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/base/hack/install_utils.sh b/base/hack/install_utils.sh index 1ab819b..94a5e0f 100755 --- a/base/hack/install_utils.sh +++ b/base/hack/install_utils.sh @@ -67,13 +67,13 @@ else fi # ks - +KS_VERSION=v0.0.64 if [[ ${ARCH} == 'x86_64' ]]; then - curl -fL https://github.com/kubesphere-sigs/ks/releases/download/v0.0.62/ks-linux-amd64.tar.gz | tar xzv && \ + curl -fL https://github.com/kubesphere-sigs/ks/releases/download/v${KS_VERSION}/ks-linux-amd64.tar.gz | tar xzv && \ mv ks /usr/bin/ elif [[ ${ARCH} == 'aarch64' ]] then - curl -fL https://github.com/kubesphere-sigs/ks/releases/download/v0.0.62/ks-linux-arm64.tar.gz | tar xzv && \ + curl -fL https://github.com/kubesphere-sigs/ks/releases/download/v${KS_VERSION}/ks-linux-arm64.tar.gz | tar xzv && \ mv ks /usr/bin/ else echo "do not support this arch" From 7ce8af82869b4cfb6af3a89d71dfbee8078c4629 Mon Sep 17 00:00:00 2001 From: rick <1450685+LinuxSuRen@users.noreply.github.com> Date: Mon, 11 Apr 2022 14:56:26 +0800 Subject: [PATCH 05/59] Fix the image name --- .github/actions/build/action.yml | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/.github/actions/build/action.yml b/.github/actions/build/action.yml index 0e29506..228a75f 100644 --- a/.github/actions/build/action.yml +++ b/.github/actions/build/action.yml @@ -47,7 +47,7 @@ runs: - name: Docker meta for KubeSphere id: meta if: github.repository_owner == 'kubesphere' - uses: docker/metadata-action@v3 + uses: docker/metadata-action@v3.7.0 with: images: | kubespheredev/${{ inputs.image-name }} @@ -55,24 +55,18 @@ runs: tags: | type=ref,event=branch,suffix=${{ inputs.tag-suffix }} type=ref,event=pr,suffix=${{ inputs.tag-suffix }} - type=semver,pattern=v{{version}}${{ inputs.tag-suffix }} - type=semver,pattern=v{{major}}.{{minor}}${{ inputs.tag-suffix }} - type=semver,pattern=v{{major}}${{ inputs.tag-suffix }} - type=sha,suffix=${{ inputs.tag-suffix }} + type=semver,pattern={{version}},prefix=v,suffix=${{ inputs.tag-suffix }} - name: Docker meta for Contributors id: metaContributors if: github.repository_owner != 'kubesphere' - uses: docker/metadata-action@v3 + uses: docker/metadata-action@v3.7.0 with: images: | ghcr.io/${{ github.repository_owner }}/${{ inputs.image-name }} tags: | type=ref,event=branch,suffix=${{ inputs.tag-suffix }} type=ref,event=pr,suffix=${{ inputs.tag-suffix }} - type=semver,pattern=v{{version}}${{ inputs.tag-suffix }} - type=semver,pattern=v{{major}}.{{minor}}${{ inputs.tag-suffix }} - type=semver,pattern=v{{major}}${{ inputs.tag-suffix }} - type=sha,suffix=${{ inputs.tag-suffix }} + type=semver,pattern={{version}},prefix=v,suffix=${{ inputs.tag-suffix }} - name: Set up QEMU uses: docker/setup-qemu-action@v1 - name: Set up Docker Buildx From e04ce393e89444bc98089cf9eed8e97cbb04f0a8 Mon Sep 17 00:00:00 2001 From: Rick <1450685+LinuxSuRen@users.noreply.github.com> Date: Wed, 13 Apr 2022 08:55:46 +0800 Subject: [PATCH 06/59] Add golang 1.17 and 1.18 (#70) --- .github/workflows/build-podman.yaml | 35 ++++++++++++++++++++++++++++- .github/workflows/build.yaml | 35 ++++++++++++++++++++++++++++- 2 files changed, 68 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-podman.yaml b/.github/workflows/build-podman.yaml index 02f0a2b..7ef2ffe 100644 --- a/.github/workflows/build-podman.yaml +++ b/.github/workflows/build-podman.yaml @@ -45,7 +45,6 @@ jobs: docker-password: ${{ secrets.DOCKER_HUB_SECRETS }} ghcr-token: ${{ secrets.GHCR_TOKEN }} build-args: "GOLANG_VERSION=1.12.10" - BuildGo16: needs: BuildBase runs-on: ubuntu-20.04 @@ -63,6 +62,40 @@ jobs: docker-password: ${{ secrets.DOCKER_HUB_SECRETS }} ghcr-token: ${{ secrets.GHCR_TOKEN }} build-args: "GOLANG_VERSION=1.16.8" + BuildGo17: + needs: BuildBase + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v2 + - name: Build Go 1.17 agent + uses: ./.github/actions/build + with: + context: go + dockerfile: go/podman/Dockerfile + image-name: builder-go + tag-suffix: -1.17-podman + platforms: linux/amd64 + docker-namespace: ${{ secrets.DOCKER_HUB_USER }} + docker-password: ${{ secrets.DOCKER_HUB_SECRETS }} + ghcr-token: ${{ secrets.GHCR_TOKEN }} + build-args: "GOLANG_VERSION=1.17.8" + BuildGo18: + needs: BuildBase + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v2 + - name: Build Go 1.18 agent + uses: ./.github/actions/build + with: + context: go + dockerfile: go/podman/Dockerfile + image-name: builder-go + tag-suffix: -1.18-podman + platforms: linux/amd64 + docker-namespace: ${{ secrets.DOCKER_HUB_USER }} + docker-password: ${{ secrets.DOCKER_HUB_SECRETS }} + ghcr-token: ${{ secrets.GHCR_TOKEN }} + build-args: "GOLANG_VERSION=1.18" BuildMaven: needs: BuildBase diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index d5a6f7d..72b1839 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -43,7 +43,6 @@ jobs: docker-password: ${{ secrets.DOCKER_HUB_SECRETS }} ghcr-token: ${{ secrets.GHCR_TOKEN }} build-args: "GOLANG_VERSION=1.12.10" - BuildGo16: needs: BuildBase runs-on: ubuntu-20.04 @@ -61,6 +60,40 @@ jobs: docker-password: ${{ secrets.DOCKER_HUB_SECRETS }} ghcr-token: ${{ secrets.GHCR_TOKEN }} build-args: "GOLANG_VERSION=1.16.8" + BuildGo17: + needs: BuildBase + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v2 + - name: Build Go 1.17 agent + uses: ./.github/actions/build + with: + context: go + dockerfile: go/Dockerfile + image-name: builder-go + tag-suffix: -1.17 + platforms: linux/amd64,linux/arm64 + docker-namespace: ${{ secrets.DOCKER_HUB_USER }} + docker-password: ${{ secrets.DOCKER_HUB_SECRETS }} + ghcr-token: ${{ secrets.GHCR_TOKEN }} + build-args: "GOLANG_VERSION=1.17.8" + BuildGo18: + needs: BuildBase + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v2 + - name: Build Go 1.18 agent + uses: ./.github/actions/build + with: + context: go + dockerfile: go/Dockerfile + image-name: builder-go + tag-suffix: -1.18 + platforms: linux/amd64,linux/arm64 + docker-namespace: ${{ secrets.DOCKER_HUB_USER }} + docker-password: ${{ secrets.DOCKER_HUB_SECRETS }} + ghcr-token: ${{ secrets.GHCR_TOKEN }} + build-args: "GOLANG_VERSION=1.18" BuildMaven: needs: BuildBase From d7797562cce10d844ab146fc8c6be39024d94f18 Mon Sep 17 00:00:00 2001 From: Rick <1450685+LinuxSuRen@users.noreply.github.com> Date: Wed, 13 Apr 2022 16:45:36 +0800 Subject: [PATCH 07/59] Fix the wrong download URL of helm and ks (#71) --- base/hack/install_utils.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/base/hack/install_utils.sh b/base/hack/install_utils.sh index 94a5e0f..f4deab1 100755 --- a/base/hack/install_utils.sh +++ b/base/hack/install_utils.sh @@ -27,7 +27,7 @@ HELM_VERSION=2.11.0 HELM3_VERSIOIN=3.5.0 if [[ ${ARCH} == 'x86_64' ]]; then - curl -f https://storage.googleapis.com/kubernetes-helm/helm-v${HELM_VERSION}-linux-amd64.tar.gz | tar xzv && \ + curl -f https://get.helm.sh/helm-v${HELM_VERSION}-linux-amd64.tar.gz | tar xzv && \ mv linux-amd64/helm /usr/bin/ && \ mv linux-amd64/tiller /usr/bin/ && \ rm -rf linux-amd64 @@ -37,7 +37,7 @@ if [[ ${ARCH} == 'x86_64' ]]; then rm -rf linux-amd64 elif [[ ${ARCH} == 'aarch64' ]] then - curl -f https://storage.googleapis.com/kubernetes-helm/helm-v${HELM_VERSION}-linux-arm64.tar.gz | tar xzv && \ + curl -f https://get.helm.sh/helm-v${HELM_VERSION}-linux-arm64.tar.gz | tar xzv && \ mv linux-arm64/helm /usr/bin/ && \ mv linux-arm64/tiller /usr/bin/ && \ rm -rf linux-arm64 @@ -67,7 +67,7 @@ else fi # ks -KS_VERSION=v0.0.64 +KS_VERSION=0.0.64 if [[ ${ARCH} == 'x86_64' ]]; then curl -fL https://github.com/kubesphere-sigs/ks/releases/download/v${KS_VERSION}/ks-linux-amd64.tar.gz | tar xzv && \ mv ks /usr/bin/ From 6675b0621e4880a81ab8cb7b9a97f77eba768522 Mon Sep 17 00:00:00 2001 From: chilianyi Date: Wed, 16 Nov 2022 17:02:30 +0800 Subject: [PATCH 08/59] Update OWNERS Add approvers and reviewers --- OWNERS | 3 +++ 1 file changed, 3 insertions(+) diff --git a/OWNERS b/OWNERS index 99614a6..f257967 100644 --- a/OWNERS +++ b/OWNERS @@ -3,6 +3,7 @@ approvers: - rayzhou2017 - shaowenchen - linuxsuren + - chilianyi reviewers: - rayzhou2017 @@ -23,3 +24,5 @@ reviewers: - soulseen - linuxsuren - JohnNiang + - chilianyi + - yudong2015 From bcfca5de1166ff4f1505eb3b6142f05be7a7fa8a Mon Sep 17 00:00:00 2001 From: chilianyi Date: Wed, 16 Nov 2022 18:45:55 +0800 Subject: [PATCH 09/59] Update OWNERS Add yudong as approvers --- OWNERS | 1 + 1 file changed, 1 insertion(+) diff --git a/OWNERS b/OWNERS index f257967..e6de9b3 100644 --- a/OWNERS +++ b/OWNERS @@ -4,6 +4,7 @@ approvers: - shaowenchen - linuxsuren - chilianyi + - yudong2015 reviewers: - rayzhou2017 From 5ea37569418d091dd6c62c6407e1d0d92628455c Mon Sep 17 00:00:00 2001 From: stark Date: Mon, 21 Nov 2022 14:17:28 +0800 Subject: [PATCH 10/59] Modify nodejs dockerfile --- nodejs/Dockerfile | 24 +++++++++++------------- nodejs/podman/Dockerfile | 24 +++++++++++------------- 2 files changed, 22 insertions(+), 26 deletions(-) diff --git a/nodejs/Dockerfile b/nodejs/Dockerfile index dcb3ad0..183fe0f 100644 --- a/nodejs/Dockerfile +++ b/nodejs/Dockerfile @@ -11,29 +11,27 @@ RUN ARCH= && uArch="$(uname -m)" \ # gpg keys listed at https://github.com/nodejs/node#release-keys && set -ex \ && for key in \ - 94AE36675C464D64BAFA68DD7434390BDBE9B9C5 \ - FD3A5288F042B6850C66B31F09FE44734EB7990E \ - 71DCFD284A79C3B38668286BC97EC7A07EDE3FC1 \ - DD8F2338BAE7501E3DD5AC78C273792F7D83545D \ - C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8 \ - B9AE9905FFD7803F25714661B63B535A4C206CA9 \ - 77984A986EBC2AA786BC0F66B01FBB92821C587A \ - 8FCCA13FEF1D0C2E91008E09770F7A9A5AE15600 \ 4ED778F539E3634C779C87C6D7062848A1AB005C \ - A48C2BEE680E841632CD4E44F07496B3EB3C1762 \ - B9E2F5981AA6E0CD28160D9FF13993A75599653C \ + 141F07595B7B3FFE74309A937405533BE57C7D57 \ + 74F12602B6F1C4E913FAA37AD3A89613643B6201 \ + 61FC681DFB92A079F1685E77973F295594EC4689 \ + 8FCCA13FEF1D0C2E91008E09770F7A9A5AE15600 \ + C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8 \ + 890C08DB8579162FEE0DF9DB8BEAB4DFCF555EF4 \ + C82FA3AE1CBEDC6BE46B9360C43CEC45C17AB93C \ + 108F52B48DB57BB0CC439B2997B01419BD92F80A \ ; do \ gpg --batch --keyserver sks.srv.dumain.com --recv-keys "$key"; \ done \ && curl -fsSLO --compressed "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-$ARCH.tar.xz" \ - && curl -fsSLO --compressed "https://nodejs.org/dist/v$NODE_VERSION/SHASUMS256.txt.asc" \ - && gpg --batch --decrypt --output SHASUMS256.txt SHASUMS256.txt.asc \ + && curl -fsSLO https://nodejs.org/dist/v$NODE_VERSION/SHASUMS256.txt \ && grep " node-v$NODE_VERSION-linux-$ARCH.tar.xz\$" SHASUMS256.txt | sha256sum -c - \ && tar -xJf "node-v$NODE_VERSION-linux-$ARCH.tar.xz" -C /usr/local --strip-components=1 --no-same-owner \ - && rm "node-v$NODE_VERSION-linux-$ARCH.tar.xz" SHASUMS256.txt.asc SHASUMS256.txt \ + && rm "node-v$NODE_VERSION-linux-$ARCH.tar.xz" SHASUMS256.txt \ && ln -s /usr/local/bin/node /usr/local/bin/nodejs \ && yum install -y nodejs gcc-c++ make bzip2 GConf2 gtk2 chromedriver chromium xorg-x11-server-Xvfb +RUN npm -g config set user root RUN npm i -g watch-cli vsce typescript # Yarn diff --git a/nodejs/podman/Dockerfile b/nodejs/podman/Dockerfile index 1eba566..a91fb7d 100644 --- a/nodejs/podman/Dockerfile +++ b/nodejs/podman/Dockerfile @@ -11,29 +11,27 @@ RUN ARCH= && uArch="$(uname -m)" \ # gpg keys listed at https://github.com/nodejs/node#release-keys && set -ex \ && for key in \ - 94AE36675C464D64BAFA68DD7434390BDBE9B9C5 \ - FD3A5288F042B6850C66B31F09FE44734EB7990E \ - 71DCFD284A79C3B38668286BC97EC7A07EDE3FC1 \ - DD8F2338BAE7501E3DD5AC78C273792F7D83545D \ - C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8 \ - B9AE9905FFD7803F25714661B63B535A4C206CA9 \ - 77984A986EBC2AA786BC0F66B01FBB92821C587A \ - 8FCCA13FEF1D0C2E91008E09770F7A9A5AE15600 \ 4ED778F539E3634C779C87C6D7062848A1AB005C \ - A48C2BEE680E841632CD4E44F07496B3EB3C1762 \ - B9E2F5981AA6E0CD28160D9FF13993A75599653C \ + 141F07595B7B3FFE74309A937405533BE57C7D57 \ + 74F12602B6F1C4E913FAA37AD3A89613643B6201 \ + 61FC681DFB92A079F1685E77973F295594EC4689 \ + 8FCCA13FEF1D0C2E91008E09770F7A9A5AE15600 \ + C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8 \ + 890C08DB8579162FEE0DF9DB8BEAB4DFCF555EF4 \ + C82FA3AE1CBEDC6BE46B9360C43CEC45C17AB93C \ + 108F52B48DB57BB0CC439B2997B01419BD92F80A \ ; do \ gpg --batch --keyserver sks.srv.dumain.com --recv-keys "$key"; \ done \ && curl -fsSLO --compressed "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-$ARCH.tar.xz" \ - && curl -fsSLO --compressed "https://nodejs.org/dist/v$NODE_VERSION/SHASUMS256.txt.asc" \ - && gpg --batch --decrypt --output SHASUMS256.txt SHASUMS256.txt.asc \ + && curl -fsSLO https://nodejs.org/dist/v$NODE_VERSION/SHASUMS256.txt \ && grep " node-v$NODE_VERSION-linux-$ARCH.tar.xz\$" SHASUMS256.txt | sha256sum -c - \ && tar -xJf "node-v$NODE_VERSION-linux-$ARCH.tar.xz" -C /usr/local --strip-components=1 --no-same-owner \ - && rm "node-v$NODE_VERSION-linux-$ARCH.tar.xz" SHASUMS256.txt.asc SHASUMS256.txt \ + && rm "node-v$NODE_VERSION-linux-$ARCH.tar.xz" SHASUMS256.txt \ && ln -s /usr/local/bin/node /usr/local/bin/nodejs \ && yum install -y nodejs gcc-c++ make bzip2 GConf2 gtk2 chromedriver chromium xorg-x11-server-Xvfb +RUN npm -g config set user root RUN npm i -g watch-cli vsce typescript # Yarn From a8c618b1227684b7bbecc6a094e3cfaf8d37d985 Mon Sep 17 00:00:00 2001 From: stark Date: Mon, 21 Nov 2022 16:49:26 +0800 Subject: [PATCH 11/59] Add maven jdk17 --- .github/workflows/build-podman.yaml | 22 +++++++++++++++++++++- .github/workflows/build.yaml | 21 ++++++++++++++++++++- Makefile | 19 +++++++++++++++++-- maven/Dockerfile | 25 ++++++++++++++++++++----- maven/podman/Dockerfile | 25 ++++++++++++++++++++----- 5 files changed, 98 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build-podman.yaml b/.github/workflows/build-podman.yaml index 7ef2ffe..3b95c5f 100644 --- a/.github/workflows/build-podman.yaml +++ b/.github/workflows/build-podman.yaml @@ -132,6 +132,26 @@ jobs: ghcr-token: ${{ secrets.GHCR_TOKEN }} build-args: "JDK_VERSION=11" + BuildMavenJDK17: + needs: BuildBase + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v2 + - name: Build maven(JDK17) agent + uses: ./.github/actions/build + with: + context: maven + dockerfile: maven/podman/Dockerfile + image-name: builder-maven + tag-suffix: -jdk17-podman + platforms: linux/amd64 + docker-namespace: ${{ secrets.DOCKER_HUB_USER }} + docker-password: ${{ secrets.DOCKER_HUB_SECRETS }} + ghcr-token: ${{ secrets.GHCR_TOKEN }} + build-args: | + "JDK_VERSION=17" + "JDK_HOME=/usr/java/default" + BuildGradle: needs: BuildBase runs-on: ubuntu-20.04 @@ -148,7 +168,7 @@ jobs: docker-namespace: ${{ secrets.DOCKER_HUB_USER }} docker-password: ${{ secrets.DOCKER_HUB_SECRETS }} ghcr-token: ${{ secrets.GHCR_TOKEN }} - + BuildNodeJs: needs: BuildBase runs-on: ubuntu-20.04 diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 72b1839..4d16f4d 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -128,6 +128,25 @@ jobs: docker-password: ${{ secrets.DOCKER_HUB_SECRETS }} ghcr-token: ${{ secrets.GHCR_TOKEN }} build-args: "JDK_VERSION=11" + BuildMavenJDK17: + needs: BuildBase + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v2 + - name: Build maven(JDK17) agent + uses: ./.github/actions/build + with: + context: maven + dockerfile: maven/Dockerfile + image-name: builder-maven + tag-suffix: -jdk17 + platforms: linux/amd64,linux/arm64 + docker-namespace: ${{ secrets.DOCKER_HUB_USER }} + docker-password: ${{ secrets.DOCKER_HUB_SECRETS }} + ghcr-token: ${{ secrets.GHCR_TOKEN }} + build-args: | + "JDK_VERSION=17" + "JDK_HOME=/usr/java/default" BuildGradle: needs: BuildBase @@ -144,7 +163,7 @@ jobs: docker-namespace: ${{ secrets.DOCKER_HUB_USER }} docker-password: ${{ secrets.DOCKER_HUB_SECRETS }} ghcr-token: ${{ secrets.GHCR_TOKEN }} - + BuildNodeJs: needs: BuildBase runs-on: ubuntu-20.04 diff --git a/Makefile b/Makefile index f9ecafb..b783e45 100644 --- a/Makefile +++ b/Makefile @@ -11,5 +11,20 @@ build-maven-podman: push-maven-podman: docker push kubespheredev/builder-maven:$(VERSION)-podman -build-jdk11: - docker build maven -f maven/Dockerfile -t kubespheredev/builder-maven:$(VERSION)-jdk11 --build-arg JDK_VERSION=11 +build-maven-jdk11: + docker build maven -f maven/Dockerfile -t kubespheredev/builder-maven:$(VERSION)-jdk11 \ +--build-arg JDK_VERSION=11 +push-maven-jdk11: + docker push kubespheredev/builder-maven:$(VERSION)-jdk11 + +build-maven-jdk17: + docker build maven -f maven/Dockerfile -t kubespheredev/builder-maven:$(VERSION)-jdk17 \ +--build-arg JDK_VERSION=17 --build-arg JDK_HOME=/usr/java/default +push-maven-jdk17: + docker push kubespheredev/builder-maven:$(VERSION)-jdk17 + +build-maven-jdk17-podman: + docker build maven -f maven/podman/Dockerfile -t kubespheredev/builder-maven:$(VERSION)-jdk17-podman \ +--build-arg JDK_VERSION=17 --build-arg JDK_HOME=/usr/java/default +push-maven-jdk17-podman: + docker push kubespheredev/builder-maven:$(VERSION)-jdk17-podman diff --git a/maven/Dockerfile b/maven/Dockerfile index 76bb5d8..14c7924 100644 --- a/maven/Dockerfile +++ b/maven/Dockerfile @@ -1,17 +1,28 @@ FROM kubespheredev/builder-base:v3.1.0 ARG JDK_VERSION 1.8.0 +ARG JDK_HOME /usr/lib/jvm/java-${JDK_VERSION}-openjdk # java -ENV JAVA_VERSIOIN $JDK_VERSION -RUN yum install -y java-${JAVA_VERSIOIN}-openjdk-devel \ - java-${JAVA_VERSIOIN}-openjdk-devel.i686 +ENV JAVA_VERSION $JDK_VERSION +RUN if [ "x${JAVA_VERSION}" = "x17" ]; then \ + ARCH= && uArch="$(uname -m)" \ + && case "${uArch##*-}" in \ + x86_64) ARCH='x64';; \ + aarch64) ARCH='aarch64';; \ + *) echo "unsupported architecture"; exit 1 ;; \ + esac \ + && wget https://download.oracle.com/java/${JAVA_VERSION}/latest/jdk-${JAVA_VERSION}_linux-${ARCH}_bin.rpm \ + && rpm -ivh jdk-${JAVA_VERSION}_linux-${ARCH}_bin.rpm; \ + else \ + yum install -y java-${JAVA_VERSION}-openjdk-devel java-${JAVA_VERSION}-openjdk-devel.i686; \ + fi # maven ENV MAVEN_VERSION 3.5.3 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 ENV M2_HOME /opt/apache-maven-$MAVEN_VERSION -ENV JAVA_HOME /usr/lib/jvm/java-${JAVA_VERSIOIN}-openjdk +ENV JAVA_HOME $JDK_HOME ENV maven.home $M2_HOME ENV M2 $M2_HOME/bin ENV PATH $M2:$PATH:JAVA_HOME/bin @@ -28,6 +39,10 @@ ENV PATH ${PATH}:/opt/ant/bin # Set JDK to be 32bit COPY set_java $M2 -RUN $M2/set_java && rm $M2/set_java +RUN if [ "x${JAVA_VERSION}" = "x17" ]; then \ + rm $M2/set_java; \ + else \ + $M2/set_java && rm $M2/set_java; \ + fi CMD ["mvn","-version"] diff --git a/maven/podman/Dockerfile b/maven/podman/Dockerfile index 3af91dc..771eec0 100644 --- a/maven/podman/Dockerfile +++ b/maven/podman/Dockerfile @@ -1,17 +1,28 @@ FROM kubespheredev/builder-base:v3.1.0-podman ARG JDK_VERSION 1.8.0 +ARG JDK_HOME /usr/lib/jvm/java-${JDK_VERSION}-openjdk # java -ENV JAVA_VERSIOIN $JDK_VERSION -RUN yum install -y java-${JAVA_VERSIOIN}-openjdk-devel \ - java-${JAVA_VERSIOIN}-openjdk-devel.i686 +ENV JAVA_VERSION $JDK_VERSION +RUN if [ "x${JAVA_VERSION}" = "x17" ]; then \ + ARCH= && uArch="$(uname -m)" \ + && case "${uArch##*-}" in \ + x86_64) ARCH='x64';; \ + aarch64) ARCH='aarch64';; \ + *) echo "unsupported architecture"; exit 1 ;; \ + esac \ + && wget https://download.oracle.com/java/${JAVA_VERSION}/latest/jdk-${JAVA_VERSION}_linux-${ARCH}_bin.rpm \ + && rpm -ivh jdk-${JAVA_VERSION}_linux-${ARCH}_bin.rpm; \ + else \ + yum install -y java-${JAVA_VERSION}-openjdk-devel java-${JAVA_VERSION}-openjdk-devel.i686; \ + fi # maven ENV MAVEN_VERSION 3.5.3 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 ENV M2_HOME /opt/apache-maven-$MAVEN_VERSION -ENV JAVA_HOME /usr/lib/jvm/java-${JAVA_VERSIOIN}-openjdk +ENV JAVA_HOME $JDK_HOME ENV maven.home $M2_HOME ENV M2 $M2_HOME/bin ENV PATH $M2:$PATH:JAVA_HOME/bin @@ -28,6 +39,10 @@ ENV PATH ${PATH}:/opt/ant/bin # Set JDK to be 32bit COPY set_java $M2 -RUN $M2/set_java && rm $M2/set_java +RUN if [ "x${JAVA_VERSION}" = "x17" ]; then \ + rm $M2/set_java; \ + else \ + $M2/set_java && rm $M2/set_java; \ + fi CMD ["mvn","-version"] From d345fa40cfbc2b96a9b5a89acfada080e192f5e1 Mon Sep 17 00:00:00 2001 From: stark Date: Tue, 27 Dec 2022 20:14:47 +0800 Subject: [PATCH 12/59] Add arm for podman image --- .github/workflows/build-podman.yaml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build-podman.yaml b/.github/workflows/build-podman.yaml index 3b95c5f..9fc4a65 100644 --- a/.github/workflows/build-podman.yaml +++ b/.github/workflows/build-podman.yaml @@ -23,7 +23,7 @@ jobs: dockerfile: base/podman/Dockerfile image-name: builder-base tag-suffix: -podman - platforms: linux/amd64 + platforms: linux/amd64,linux/arm64 docker-namespace: ${{ secrets.DOCKER_HUB_USER }} docker-password: ${{ secrets.DOCKER_HUB_SECRETS }} ghcr-token: ${{ secrets.GHCR_TOKEN }} @@ -40,7 +40,7 @@ jobs: dockerfile: go/podman/Dockerfile image-name: builder-go tag-suffix: -podman - platforms: linux/amd64 + platforms: linux/amd64,linux/arm64 docker-namespace: ${{ secrets.DOCKER_HUB_USER }} docker-password: ${{ secrets.DOCKER_HUB_SECRETS }} ghcr-token: ${{ secrets.GHCR_TOKEN }} @@ -57,7 +57,7 @@ jobs: dockerfile: go/podman/Dockerfile image-name: builder-go tag-suffix: -1.16-podman - platforms: linux/amd64 + platforms: linux/amd64,linux/arm64 docker-namespace: ${{ secrets.DOCKER_HUB_USER }} docker-password: ${{ secrets.DOCKER_HUB_SECRETS }} ghcr-token: ${{ secrets.GHCR_TOKEN }} @@ -74,7 +74,7 @@ jobs: dockerfile: go/podman/Dockerfile image-name: builder-go tag-suffix: -1.17-podman - platforms: linux/amd64 + platforms: linux/amd64,linux/arm64 docker-namespace: ${{ secrets.DOCKER_HUB_USER }} docker-password: ${{ secrets.DOCKER_HUB_SECRETS }} ghcr-token: ${{ secrets.GHCR_TOKEN }} @@ -91,7 +91,7 @@ jobs: dockerfile: go/podman/Dockerfile image-name: builder-go tag-suffix: -1.18-podman - platforms: linux/amd64 + platforms: linux/amd64,linux/arm64 docker-namespace: ${{ secrets.DOCKER_HUB_USER }} docker-password: ${{ secrets.DOCKER_HUB_SECRETS }} ghcr-token: ${{ secrets.GHCR_TOKEN }} @@ -109,7 +109,7 @@ jobs: dockerfile: maven/podman/Dockerfile image-name: builder-maven tag-suffix: -podman - platforms: linux/amd64 + platforms: linux/amd64,linux/arm64 docker-namespace: ${{ secrets.DOCKER_HUB_USER }} docker-password: ${{ secrets.DOCKER_HUB_SECRETS }} ghcr-token: ${{ secrets.GHCR_TOKEN }} @@ -126,7 +126,7 @@ jobs: dockerfile: maven/podman/Dockerfile image-name: builder-maven tag-suffix: -jdk11-podman - platforms: linux/amd64 + platforms: linux/amd64,linux/arm64 docker-namespace: ${{ secrets.DOCKER_HUB_USER }} docker-password: ${{ secrets.DOCKER_HUB_SECRETS }} ghcr-token: ${{ secrets.GHCR_TOKEN }} @@ -144,7 +144,7 @@ jobs: dockerfile: maven/podman/Dockerfile image-name: builder-maven tag-suffix: -jdk17-podman - platforms: linux/amd64 + platforms: linux/amd64,linux/arm64 docker-namespace: ${{ secrets.DOCKER_HUB_USER }} docker-password: ${{ secrets.DOCKER_HUB_SECRETS }} ghcr-token: ${{ secrets.GHCR_TOKEN }} @@ -164,7 +164,7 @@ jobs: dockerfile: gradle/podman/Dockerfile image-name: builder-gradle tag-suffix: -podman - platforms: linux/amd64 + platforms: linux/amd64,linux/arm64 docker-namespace: ${{ secrets.DOCKER_HUB_USER }} docker-password: ${{ secrets.DOCKER_HUB_SECRETS }} ghcr-token: ${{ secrets.GHCR_TOKEN }} @@ -181,7 +181,7 @@ jobs: dockerfile: nodejs/podman/Dockerfile image-name: builder-nodejs tag-suffix: -podman - platforms: linux/amd64 + platforms: linux/amd64,linux/arm64 docker-namespace: ${{ secrets.DOCKER_HUB_USER }} docker-password: ${{ secrets.DOCKER_HUB_SECRETS }} ghcr-token: ${{ secrets.GHCR_TOKEN }} @@ -198,7 +198,7 @@ jobs: dockerfile: python/podman/Dockerfile image-name: builder-python tag-suffix: -podman - platforms: linux/amd64 + platforms: linux/amd64,linux/arm64 docker-namespace: ${{ secrets.DOCKER_HUB_USER }} docker-password: ${{ secrets.DOCKER_HUB_SECRETS }} ghcr-token: ${{ secrets.GHCR_TOKEN }} From 7d3eb78ea07c59b1be7d11efe23beef04c73a140 Mon Sep 17 00:00:00 2001 From: stoneshi-yunify Date: Fri, 7 Mar 2025 11:45:05 +0800 Subject: [PATCH 13/59] use ubuntu to build image Signed-off-by: stoneshi-yunify --- .github/actions/build/action.yml | 44 +----- .github/workflows/build-podman.yaml | 204 ---------------------------- .github/workflows/build.yaml | 197 +-------------------------- base/Dockerfile | 136 ++++++++++++------- base/Jenkinsfile | 43 ------ base/README.md | 14 +- base/hack/install_utils.sh | 95 ------------- base/podman/Dockerfile | 70 ---------- 8 files changed, 100 insertions(+), 703 deletions(-) delete mode 100644 .github/workflows/build-podman.yaml delete mode 100644 base/Jenkinsfile delete mode 100755 base/hack/install_utils.sh delete mode 100644 base/podman/Dockerfile diff --git a/.github/actions/build/action.yml b/.github/actions/build/action.yml index 228a75f..9998604 100644 --- a/.github/actions/build/action.yml +++ b/.github/actions/build/action.yml @@ -43,50 +43,31 @@ inputs: runs: using: composite steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Docker meta for KubeSphere id: meta if: github.repository_owner == 'kubesphere' - uses: docker/metadata-action@v3.7.0 + uses: docker/metadata-action@v5 with: images: | - kubespheredev/${{ inputs.image-name }} - ghcr.io/${{ github.repository_owner }}/${{ inputs.image-name }} - tags: | - type=ref,event=branch,suffix=${{ inputs.tag-suffix }} - type=ref,event=pr,suffix=${{ inputs.tag-suffix }} - type=semver,pattern={{version}},prefix=v,suffix=${{ inputs.tag-suffix }} - - name: Docker meta for Contributors - id: metaContributors - if: github.repository_owner != 'kubesphere' - uses: docker/metadata-action@v3.7.0 - with: - images: | - ghcr.io/${{ github.repository_owner }}/${{ inputs.image-name }} + kubesphere/${{ inputs.image-name }} tags: | type=ref,event=branch,suffix=${{ inputs.tag-suffix }} type=ref,event=pr,suffix=${{ inputs.tag-suffix }} type=semver,pattern={{version}},prefix=v,suffix=${{ inputs.tag-suffix }} - name: Set up QEMU - uses: docker/setup-qemu-action@v1 + uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 + uses: docker/setup-buildx-action@v3 - name: Login to DockerHub if: github.event_name != 'pull_request' && github.repository_owner == 'kubesphere' - uses: docker/login-action@v1 + uses: docker/login-action@v3 with: registry: ${{ inputs.docker-registry }} username: ${{ inputs.docker-namespace }} password: ${{ inputs.docker-password }} - - name: Login to GHCR - if: github.event_name != 'pull_request' - uses: docker/login-action@v1 - with: - registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ inputs.ghcr-token }} - name: Build and push Docker images - uses: docker/build-push-action@v2 + uses: docker/build-push-action@v6 if: github.repository_owner == 'kubesphere' with: context: ${{ inputs.context }} @@ -96,14 +77,3 @@ runs: labels: ${{ steps.meta.outputs.labels }} platforms: ${{ inputs.platforms }} build-args: ${{ inputs.build-args }} - - name: Build and push Docker images for Contributors - uses: docker/build-push-action@v2 - if: github.repository_owner != 'kubesphere' - with: - context: ${{ inputs.context }} - file: ${{ inputs.dockerfile }} - tags: ${{ steps.metaContributors.outputs.tags }} - push: ${{ github.event_name != 'pull_request' }} - labels: ${{ steps.metaContributors.outputs.labels }} - platforms: ${{ inputs.platforms }} - build-args: ${{ inputs.build-args }} diff --git a/.github/workflows/build-podman.yaml b/.github/workflows/build-podman.yaml deleted file mode 100644 index 9fc4a65..0000000 --- a/.github/workflows/build-podman.yaml +++ /dev/null @@ -1,204 +0,0 @@ -name: Build Podman Images - -on: - push: - branches: - - master - - test-* # make it be easier for contributors to test - tags: - - 'v*.*.*' - pull_request: - branches: - - 'master' - -jobs: - BuildBase: - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v2 - - name: Build base agent - uses: ./.github/actions/build - with: - context: base - dockerfile: base/podman/Dockerfile - image-name: builder-base - tag-suffix: -podman - platforms: linux/amd64,linux/arm64 - docker-namespace: ${{ secrets.DOCKER_HUB_USER }} - docker-password: ${{ secrets.DOCKER_HUB_SECRETS }} - ghcr-token: ${{ secrets.GHCR_TOKEN }} - - BuildGo: - needs: BuildBase - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v2 - - name: Build Go agent - uses: ./.github/actions/build - with: - context: go - dockerfile: go/podman/Dockerfile - image-name: builder-go - tag-suffix: -podman - platforms: linux/amd64,linux/arm64 - docker-namespace: ${{ secrets.DOCKER_HUB_USER }} - docker-password: ${{ secrets.DOCKER_HUB_SECRETS }} - ghcr-token: ${{ secrets.GHCR_TOKEN }} - build-args: "GOLANG_VERSION=1.12.10" - BuildGo16: - needs: BuildBase - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v2 - - name: Build Go 1.16 agent - uses: ./.github/actions/build - with: - context: go - dockerfile: go/podman/Dockerfile - image-name: builder-go - tag-suffix: -1.16-podman - platforms: linux/amd64,linux/arm64 - docker-namespace: ${{ secrets.DOCKER_HUB_USER }} - docker-password: ${{ secrets.DOCKER_HUB_SECRETS }} - ghcr-token: ${{ secrets.GHCR_TOKEN }} - build-args: "GOLANG_VERSION=1.16.8" - BuildGo17: - needs: BuildBase - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v2 - - name: Build Go 1.17 agent - uses: ./.github/actions/build - with: - context: go - dockerfile: go/podman/Dockerfile - image-name: builder-go - tag-suffix: -1.17-podman - platforms: linux/amd64,linux/arm64 - docker-namespace: ${{ secrets.DOCKER_HUB_USER }} - docker-password: ${{ secrets.DOCKER_HUB_SECRETS }} - ghcr-token: ${{ secrets.GHCR_TOKEN }} - build-args: "GOLANG_VERSION=1.17.8" - BuildGo18: - needs: BuildBase - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v2 - - name: Build Go 1.18 agent - uses: ./.github/actions/build - with: - context: go - dockerfile: go/podman/Dockerfile - image-name: builder-go - tag-suffix: -1.18-podman - platforms: linux/amd64,linux/arm64 - docker-namespace: ${{ secrets.DOCKER_HUB_USER }} - docker-password: ${{ secrets.DOCKER_HUB_SECRETS }} - ghcr-token: ${{ secrets.GHCR_TOKEN }} - build-args: "GOLANG_VERSION=1.18" - - BuildMaven: - needs: BuildBase - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v2 - - name: Build maven agent - uses: ./.github/actions/build - with: - context: maven - dockerfile: maven/podman/Dockerfile - image-name: builder-maven - tag-suffix: -podman - platforms: linux/amd64,linux/arm64 - docker-namespace: ${{ secrets.DOCKER_HUB_USER }} - docker-password: ${{ secrets.DOCKER_HUB_SECRETS }} - ghcr-token: ${{ secrets.GHCR_TOKEN }} - build-args: "JDK_VERSION=1.8.0" - BuildMavenJDK11: - needs: BuildBase - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v2 - - name: Build maven(JDK11) agent - uses: ./.github/actions/build - with: - context: maven - dockerfile: maven/podman/Dockerfile - image-name: builder-maven - tag-suffix: -jdk11-podman - platforms: linux/amd64,linux/arm64 - docker-namespace: ${{ secrets.DOCKER_HUB_USER }} - docker-password: ${{ secrets.DOCKER_HUB_SECRETS }} - ghcr-token: ${{ secrets.GHCR_TOKEN }} - build-args: "JDK_VERSION=11" - - BuildMavenJDK17: - needs: BuildBase - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v2 - - name: Build maven(JDK17) agent - uses: ./.github/actions/build - with: - context: maven - dockerfile: maven/podman/Dockerfile - image-name: builder-maven - tag-suffix: -jdk17-podman - platforms: linux/amd64,linux/arm64 - docker-namespace: ${{ secrets.DOCKER_HUB_USER }} - docker-password: ${{ secrets.DOCKER_HUB_SECRETS }} - ghcr-token: ${{ secrets.GHCR_TOKEN }} - build-args: | - "JDK_VERSION=17" - "JDK_HOME=/usr/java/default" - - BuildGradle: - needs: BuildBase - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v2 - - name: Build Gradle agent - uses: ./.github/actions/build - with: - context: gradle - dockerfile: gradle/podman/Dockerfile - image-name: builder-gradle - tag-suffix: -podman - platforms: linux/amd64,linux/arm64 - docker-namespace: ${{ secrets.DOCKER_HUB_USER }} - docker-password: ${{ secrets.DOCKER_HUB_SECRETS }} - ghcr-token: ${{ secrets.GHCR_TOKEN }} - - BuildNodeJs: - needs: BuildBase - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v2 - - name: Build NodeJS agent - uses: ./.github/actions/build - with: - context: nodejs - dockerfile: nodejs/podman/Dockerfile - image-name: builder-nodejs - tag-suffix: -podman - platforms: linux/amd64,linux/arm64 - docker-namespace: ${{ secrets.DOCKER_HUB_USER }} - docker-password: ${{ secrets.DOCKER_HUB_SECRETS }} - ghcr-token: ${{ secrets.GHCR_TOKEN }} - - BuildPython: - needs: BuildBase - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v2 - - name: Build Python agent - uses: ./.github/actions/build - with: - context: python - dockerfile: python/podman/Dockerfile - image-name: builder-python - tag-suffix: -podman - platforms: linux/amd64,linux/arm64 - docker-namespace: ${{ secrets.DOCKER_HUB_USER }} - docker-password: ${{ secrets.DOCKER_HUB_SECRETS }} - ghcr-token: ${{ secrets.GHCR_TOKEN }} diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 4d16f4d..84c1841 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -1,21 +1,18 @@ name: Build Images on: + workflow_dispatch: push: branches: - - master - - test-* # make it be easier for contributors to test + - master tags: - 'v*.*.*' - pull_request: - branches: - - 'master' jobs: BuildBase: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Build base agent uses: ./.github/actions/build with: @@ -25,189 +22,3 @@ jobs: platforms: linux/amd64,linux/arm64 docker-namespace: ${{ secrets.DOCKER_HUB_USER }} docker-password: ${{ secrets.DOCKER_HUB_SECRETS }} - ghcr-token: ${{ secrets.GHCR_TOKEN }} - - BuildGo: - needs: BuildBase - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v2 - - name: Build Go agent - uses: ./.github/actions/build - with: - context: go - dockerfile: go/Dockerfile - image-name: builder-go - platforms: linux/amd64,linux/arm64 - docker-namespace: ${{ secrets.DOCKER_HUB_USER }} - docker-password: ${{ secrets.DOCKER_HUB_SECRETS }} - ghcr-token: ${{ secrets.GHCR_TOKEN }} - build-args: "GOLANG_VERSION=1.12.10" - BuildGo16: - needs: BuildBase - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v2 - - name: Build Go 1.16 agent - uses: ./.github/actions/build - with: - context: go - dockerfile: go/Dockerfile - image-name: builder-go - tag-suffix: -1.16 - platforms: linux/amd64,linux/arm64 - docker-namespace: ${{ secrets.DOCKER_HUB_USER }} - docker-password: ${{ secrets.DOCKER_HUB_SECRETS }} - ghcr-token: ${{ secrets.GHCR_TOKEN }} - build-args: "GOLANG_VERSION=1.16.8" - BuildGo17: - needs: BuildBase - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v2 - - name: Build Go 1.17 agent - uses: ./.github/actions/build - with: - context: go - dockerfile: go/Dockerfile - image-name: builder-go - tag-suffix: -1.17 - platforms: linux/amd64,linux/arm64 - docker-namespace: ${{ secrets.DOCKER_HUB_USER }} - docker-password: ${{ secrets.DOCKER_HUB_SECRETS }} - ghcr-token: ${{ secrets.GHCR_TOKEN }} - build-args: "GOLANG_VERSION=1.17.8" - BuildGo18: - needs: BuildBase - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v2 - - name: Build Go 1.18 agent - uses: ./.github/actions/build - with: - context: go - dockerfile: go/Dockerfile - image-name: builder-go - tag-suffix: -1.18 - platforms: linux/amd64,linux/arm64 - docker-namespace: ${{ secrets.DOCKER_HUB_USER }} - docker-password: ${{ secrets.DOCKER_HUB_SECRETS }} - ghcr-token: ${{ secrets.GHCR_TOKEN }} - build-args: "GOLANG_VERSION=1.18" - - BuildMaven: - needs: BuildBase - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v2 - - name: Build maven agent - uses: ./.github/actions/build - with: - context: maven - dockerfile: maven/Dockerfile - image-name: builder-maven - platforms: linux/amd64,linux/arm64 - docker-namespace: ${{ secrets.DOCKER_HUB_USER }} - docker-password: ${{ secrets.DOCKER_HUB_SECRETS }} - ghcr-token: ${{ secrets.GHCR_TOKEN }} - build-args: "JDK_VERSION=1.8.0" - BuildMavenJDK11: - needs: BuildBase - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v2 - - name: Build maven(JDK11) agent - uses: ./.github/actions/build - with: - context: maven - dockerfile: maven/Dockerfile - image-name: builder-maven - tag-suffix: -jdk11 - platforms: linux/amd64,linux/arm64 - docker-namespace: ${{ secrets.DOCKER_HUB_USER }} - docker-password: ${{ secrets.DOCKER_HUB_SECRETS }} - ghcr-token: ${{ secrets.GHCR_TOKEN }} - build-args: "JDK_VERSION=11" - BuildMavenJDK17: - needs: BuildBase - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v2 - - name: Build maven(JDK17) agent - uses: ./.github/actions/build - with: - context: maven - dockerfile: maven/Dockerfile - image-name: builder-maven - tag-suffix: -jdk17 - platforms: linux/amd64,linux/arm64 - docker-namespace: ${{ secrets.DOCKER_HUB_USER }} - docker-password: ${{ secrets.DOCKER_HUB_SECRETS }} - ghcr-token: ${{ secrets.GHCR_TOKEN }} - build-args: | - "JDK_VERSION=17" - "JDK_HOME=/usr/java/default" - - BuildGradle: - needs: BuildBase - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v2 - - name: Build Gradle agent - uses: ./.github/actions/build - with: - context: gradle - dockerfile: gradle/Dockerfile - image-name: builder-gradle - platforms: linux/amd64,linux/arm64 - docker-namespace: ${{ secrets.DOCKER_HUB_USER }} - docker-password: ${{ secrets.DOCKER_HUB_SECRETS }} - ghcr-token: ${{ secrets.GHCR_TOKEN }} - - BuildNodeJs: - needs: BuildBase - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v2 - - name: Build NodeJS agent - uses: ./.github/actions/build - with: - context: nodejs - dockerfile: nodejs/Dockerfile - image-name: builder-nodejs - platforms: linux/amd64,linux/arm64 - docker-namespace: ${{ secrets.DOCKER_HUB_USER }} - docker-password: ${{ secrets.DOCKER_HUB_SECRETS }} - ghcr-token: ${{ secrets.GHCR_TOKEN }} - - BuildDotnet: - needs: BuildBase - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v2 - - name: Build DotNet agent - uses: ./.github/actions/build - with: - context: dotnet - dockerfile: dotnet/Dockerfile - image-name: builder-dotnet - platforms: linux/amd64,linux/arm64 - docker-namespace: ${{ secrets.DOCKER_HUB_USER }} - docker-password: ${{ secrets.DOCKER_HUB_SECRETS }} - ghcr-token: ${{ secrets.GHCR_TOKEN }} - - BuildPython: - needs: BuildBase - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v2 - - name: Build Python agent - uses: ./.github/actions/build - with: - context: python - dockerfile: python/Dockerfile - image-name: builder-python - platforms: linux/amd64,linux/arm64 - docker-namespace: ${{ secrets.DOCKER_HUB_USER }} - docker-password: ${{ secrets.DOCKER_HUB_SECRETS }} - ghcr-token: ${{ secrets.GHCR_TOKEN }} diff --git a/base/Dockerfile b/base/Dockerfile index ecc5d48..09eb3cd 100644 --- a/base/Dockerfile +++ b/base/Dockerfile @@ -1,59 +1,99 @@ -FROM centos:7 - -# utils -RUN yum install -y epel-release ca-certificates && \ - yum install -y unzip \ - which \ - make \ - wget \ - zip \ - bzip2 \ - gcc \ - gcc-c++ \ - curl-devel \ - autoconf \ - expat-devel \ - gettext-devel \ - openssl-devel \ - perl-devel \ - zlib-devel \ - python-pip \ - java-1.8.0-openjdk && \ - yum -y clean all --enablerepo='*' - -RUN wget https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.9.5.tar.gz && \ - tar zxvf git-2.9.5.tar.gz --no-same-owner && \ - cd git-2.9.5 && \ - make configure && \ - ./configure prefix=/usr/local/git/ && \ - make && \ - make install && \ - mv /usr/local/git/bin/git /usr/bin/ && \ - cd ..&& \ - rm -rf git-2.9.5.tar.gz git-2.9.5 && \ - git version - - +FROM ubuntu:24.04 # Set the locale(en_US.UTF-8) ENV LANG en_US.UTF-8 ENV LANGUAGE en_US:en ENV LC_ALL en_US.UTF-8 +ENV PATH $PATH:/usr/local/bin -# USER jenkins -WORKDIR /home/jenkins +# Install additional utils not included by default +RUN apt-get update && \ + apt-get install -y \ + ca-certificates \ + curl \ + perl \ + openssl \ + gnupg \ + unzip \ + make \ + wget \ + zip \ + bzip2 \ + vim \ + jq \ + yq \ + gcc \ + g++ \ + libcurl4-openssl-dev \ + build-essential \ + autoconf \ + libexpat1-dev \ + gettext \ + libssl-dev \ + libperl-dev \ + zlib1g-dev \ + python3-pip \ + podman \ + openjdk-21-jdk && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* + +# Install docker CLI +RUN apt-get install -m 0755 -d /etc/apt/keyrings && \ + curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg && \ + chmod a+r /etc/apt/keyrings/docker.gpg && \ + echo \ + "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \ + $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \ + tee /etc/apt/sources.list.d/docker.list > /dev/null && \ + apt-get update && \ + apt-get install -y docker-ce-cli && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* + +# Install helm +RUN curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 && \ + chmod 700 get_helm.sh && \ + ./get_helm.sh && \ + rm get_helm.sh + +# Install kubectl +RUN curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/$(dpkg --print-architecture)/kubectl" && \ + install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl && \ + rm kubectl -ENV SONAR_SCANNER_VERSION 3.3.0.1492 +# Install kustomize +RUN curl -s "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" | bash -RUN curl -o sonar_scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-${SONAR_SCANNER_VERSION}-linux.zip && \ - unzip sonar_scanner.zip && rm sonar_scanner.zip \ - && rm -rf sonar-scanner-$SONAR_SCANNER_VERSION-linux/jre && \ - sed -i 's/use_embedded_jre=true/use_embedded_jre=false/g' /home/jenkins/sonar-scanner-$SONAR_SCANNER_VERSION-linux/bin/sonar-scanner && \ - mv /home/jenkins/sonar-scanner-$SONAR_SCANNER_VERSION-linux /usr/bin +# Set up Sonar Scanner +ENV SONAR_SCANNER_VERSION 7.0.2.4839 -ENV PATH $PATH:/usr/bin/sonar-scanner-$SONAR_SCANNER_VERSION-linux/bin +# Install Sonar Scanner CLI +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 && \ + ln -s /opt/sonar-scanner-$SONAR_SCANNER_VERSION-${TARGET_ARCH}/bin/sonar-scanner /usr/local/bin/sonar-scanner -COPY ./ ./ -RUN ./hack/install_utils.sh && rm -rf ./* +# 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/ + + +RUN mkdir -p /etc/containers +COPY *.conf /etc/containers/ + +VOLUME /var/lib/containers + +# Set working directory +WORKDIR /home/jenkins -CMD ["docker","version"] +# Default command +CMD ["docker", "version"] diff --git a/base/Jenkinsfile b/base/Jenkinsfile deleted file mode 100644 index ca3c3c1..0000000 --- a/base/Jenkinsfile +++ /dev/null @@ -1,43 +0,0 @@ -pipeline { - agent { - node { - label 'base' - } - - } - stages { - stage('build and tag image') { - steps { - container('base') { - sh '''docker build -t kubespheredev/builder-base . -docker tag kubespheredev/builder-base kubespheredev/builder-base:2.1.0''' - } - - } - } - stage('docker push') { - when{ - branch 'master' - } - steps { - container('base') { - withCredentials([usernamePassword(passwordVariable : 'DOCKER_PASSWORD' ,usernameVariable : 'DOCKER_USERNAME' ,credentialsId : 'dockerhub-id' ,)]) { - sh 'echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin' - } - sh 'docker push kubespheredev/builder-base' - } - } - } - stage('update language image'){ - when{ - branch 'master' - } - steps{ - build job:'../builder-maven/master', wait: false - build job:'../builder-nodejs/master', wait: false - build job:'../builder-go/master', wait: false - build job:'../builder-dotnet/master', wait: false - } - } - } -} diff --git a/base/README.md b/base/README.md index 7577c4f..fdcbc99 100644 --- a/base/README.md +++ b/base/README.md @@ -1,14 +1,2 @@ -There're two base images based on different container runtime: - -* Docker -* Podman - -## Podman - -In order to make it be easy to use. We provide some default conf files: - -* [containers.conf](containers.conf) -* [registries.conf](registries.conf) - * Add `docker.io` into the default registries for keeping compatible -* [storage.conf](storage.conf) +Base image with docker and podman diff --git a/base/hack/install_utils.sh b/base/hack/install_utils.sh deleted file mode 100755 index f4deab1..0000000 --- a/base/hack/install_utils.sh +++ /dev/null @@ -1,95 +0,0 @@ -#!/usr/bin/env bash - -ARCH=$(uname -m) - -echo $ARCH - -if [[ ${EXCLUDE_DOCKER} != '1' ]]; then - # Docker - DOCKER_VERSION=18.09.9 - if [[ ${ARCH} == 'x86_64' ]]; then - curl -f https://download.docker.com/linux/static/stable/x86_64/docker-$DOCKER_VERSION.tgz | tar xvz && \ - mv docker/docker /usr/bin/ && \ - rm -rf docker - elif [[ ${ARCH} == 'aarch64' ]] - then - curl -f https://download.docker.com/linux/static/stable/aarch64/docker-$DOCKER_VERSION.tgz | tar xvz && \ - mv docker/docker /usr/bin/ && \ - rm -rf docker - else - echo "do not support this arch" - exit 1 - fi -fi - -# Helm -HELM_VERSION=2.11.0 -HELM3_VERSIOIN=3.5.0 - -if [[ ${ARCH} == 'x86_64' ]]; then - curl -f https://get.helm.sh/helm-v${HELM_VERSION}-linux-amd64.tar.gz | tar xzv && \ - mv linux-amd64/helm /usr/bin/ && \ - mv linux-amd64/tiller /usr/bin/ && \ - rm -rf linux-amd64 - - curl -f https://get.helm.sh/helm-v${HELM3_VERSIOIN}-linux-amd64.tar.gz | tar xzv && \ - mv linux-amd64/helm /usr/bin/helm3 && \ - rm -rf linux-amd64 -elif [[ ${ARCH} == 'aarch64' ]] -then - curl -f https://get.helm.sh/helm-v${HELM_VERSION}-linux-arm64.tar.gz | tar xzv && \ - mv linux-arm64/helm /usr/bin/ && \ - mv linux-arm64/tiller /usr/bin/ && \ - rm -rf linux-arm64 - - curl -f https://get.helm.sh/helm-v${HELM3_VERSIOIN}-linux-arm64.tar.gz | tar xzv && \ - mv linux-arm64/helm /usr/bin/helm3 && \ - rm -rf linux-arm64 -else - echo "do not support this arch" - exit 1 -fi - -# kubectl - -if [[ ${ARCH} == 'x86_64' ]]; then - curl -f -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl && \ - chmod +x kubectl && \ - mv kubectl /usr/bin/ -elif [[ ${ARCH} == 'aarch64' ]] -then - curl -f -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/arm64/kubectl && \ - chmod +x kubectl && \ - mv kubectl /usr/bin/ && kubectl --help -else - echo "do not support this arch" - exit 1 -fi - -# ks -KS_VERSION=0.0.64 -if [[ ${ARCH} == 'x86_64' ]]; then - curl -fL https://github.com/kubesphere-sigs/ks/releases/download/v${KS_VERSION}/ks-linux-amd64.tar.gz | tar xzv && \ - mv ks /usr/bin/ -elif [[ ${ARCH} == 'aarch64' ]] -then - curl -fL https://github.com/kubesphere-sigs/ks/releases/download/v${KS_VERSION}/ks-linux-arm64.tar.gz | tar xzv && \ - mv ks /usr/bin/ -else - echo "do not support this arch" - exit 1 -fi - -# kustomize -KUSTOMIZE_VERSION=4.5.3 -if [[ ${ARCH} == 'x86_64' ]]; then - curl -fL https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize%2Fv${KUSTOMIZE_VERSION}/kustomize_v${KUSTOMIZE_VERSION}_linux_amd64.tar.gz | tar xzv && \ - mv kustomize /usr/bin/ -elif [[ ${ARCH} == 'aarch64' ]] -then - curl -fL https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize%2Fv${KUSTOMIZE_VERSION}/kustomize_v${KUSTOMIZE_VERSION}_linux_arm64.tar.gz | tar xzv && \ - mv kustomize /usr/bin/ -else - echo "do not support this arch" - exit 1 -fi diff --git a/base/podman/Dockerfile b/base/podman/Dockerfile deleted file mode 100644 index 8934da6..0000000 --- a/base/podman/Dockerfile +++ /dev/null @@ -1,70 +0,0 @@ -FROM centos:7 - -# utils -RUN yum install -y epel-release ca-certificates && \ - yum install -y unzip \ - which \ - make \ - wget \ - zip \ - bzip2 \ - gcc \ - gcc-c++ \ - curl-devel \ - autoconf \ - expat-devel \ - gettext-devel \ - openssl-devel \ - perl-devel \ - zlib-devel \ - python-pip \ - java-1.8.0-openjdk && \ - yum -y clean all --enablerepo='*' - -RUN wget https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.9.5.tar.gz && \ - tar zxvf git-2.9.5.tar.gz --no-same-owner && \ - cd git-2.9.5 && \ - make configure && \ - ./configure prefix=/usr/local/git/ && \ - make && \ - make install && \ - mv /usr/local/git/bin/git /usr/bin/ && \ - cd .. && \ - rm -rf git-2.9.5.tar.gz git-2.9.5 && \ - git version - -# Set the locale(en_US.UTF-8) -ENV LANG en_US.UTF-8 -ENV LANGUAGE en_US:en -ENV LC_ALL en_US.UTF-8 - -# USER jenkins -WORKDIR /home/jenkins - -ENV SONAR_SCANNER_VERSION 3.3.0.1492 - -RUN curl -o sonar_scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-${SONAR_SCANNER_VERSION}-linux.zip && \ - unzip sonar_scanner.zip && rm sonar_scanner.zip \ - && rm -rf sonar-scanner-$SONAR_SCANNER_VERSION-linux/jre && \ - sed -i 's/use_embedded_jre=true/use_embedded_jre=false/g' /home/jenkins/sonar-scanner-$SONAR_SCANNER_VERSION-linux/bin/sonar-scanner && \ - mv /home/jenkins/sonar-scanner-$SONAR_SCANNER_VERSION-linux /usr/bin - -ENV PATH $PATH:/usr/bin/sonar-scanner-$SONAR_SCANNER_VERSION-linux/bin - -COPY ./ ./ - -ENV EXCLUDE_DOCKER 1 -RUN ./hack/install_utils.sh && rm -rf ./* - -# Install podman -RUN curl -L -o /etc/yum.repos.d/devel:kubic:libcontainers:stable.repo https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/CentOS_7/devel:kubic:libcontainers:stable.repo && \ - yum -y install podman fuse-overlayfs && \ - ln -s /usr/bin/podman /usr/bin/docker && \ - yum -y clean all --enablerepo='*' - -COPY storage.conf /etc/containers/storage.conf -COPY containers.conf /etc/containers/containers.conf - -VOLUME /var/lib/containers - -CMD ["podman", "info"] From 60bea5e52327ea371c3781767396ee59304327d5 Mon Sep 17 00:00:00 2001 From: stoneshi-yunify Date: Fri, 7 Mar 2025 12:41:52 +0800 Subject: [PATCH 14/59] fix dockerfile Signed-off-by: stoneshi-yunify --- base/Dockerfile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/base/Dockerfile b/base/Dockerfile index 09eb3cd..45ed4fb 100644 --- a/base/Dockerfile +++ b/base/Dockerfile @@ -40,14 +40,14 @@ RUN apt-get update && \ # Install docker CLI RUN apt-get install -m 0755 -d /etc/apt/keyrings && \ - curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg && \ - chmod a+r /etc/apt/keyrings/docker.gpg && \ + curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc && \ + chmod a+r /etc/apt/keyrings/docker.asc && \ echo \ - "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \ - $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \ + "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \ + $(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}") stable" | \ tee /etc/apt/sources.list.d/docker.list > /dev/null && \ apt-get update && \ - apt-get install -y docker-ce-cli && \ + apt-get install -y docker-ce-cli docker-buildx-plugin docker-compose-plugin && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* From fb3dc588afef8930ba0da17f16e89a115bd50a9e Mon Sep 17 00:00:00 2001 From: stoneshi-yunify Date: Fri, 7 Mar 2025 12:49:39 +0800 Subject: [PATCH 15/59] fix dockerfile Signed-off-by: stoneshi-yunify --- base/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base/Dockerfile b/base/Dockerfile index 45ed4fb..c12b2c0 100644 --- a/base/Dockerfile +++ b/base/Dockerfile @@ -39,7 +39,7 @@ RUN apt-get update && \ rm -rf /var/lib/apt/lists/* # Install docker CLI -RUN apt-get install -m 0755 -d /etc/apt/keyrings && \ +RUN install -m 0755 -d /etc/apt/keyrings && \ curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc && \ chmod a+r /etc/apt/keyrings/docker.asc && \ echo \ From 489ce811aeb3883c153b3e498f606ce98aec8c24 Mon Sep 17 00:00:00 2001 From: stoneshi-yunify Date: Fri, 7 Mar 2025 15:44:45 +0800 Subject: [PATCH 16/59] update dockerfile Signed-off-by: stoneshi-yunify --- base/Dockerfile | 92 ++++++++++++++++-- base/README.md | 2 +- dotnet/Dockerfile | 15 --- dotnet/Jenkinsfile | 32 ------- dotnet/LICENSE | 201 --------------------------------------- go/.gitignore | 9 -- go/Dockerfile | 19 ---- go/Jenkinsfile | 32 ------- go/LICENSE | 201 --------------------------------------- go/hack/install_utils.sh | 21 ---- go/podman/Dockerfile | 19 ---- gradle/Dockerfile | 23 ----- gradle/Jenkinsfile | 32 ------- gradle/podman/Dockerfile | 13 --- gradle/set_java | 14 --- maven/Dockerfile | 48 ---------- maven/Jenkinsfile | 32 ------- maven/LICENSE | 201 --------------------------------------- maven/podman/Dockerfile | 48 ---------- maven/set_java | 14 --- nodejs/Dockerfile | 43 --------- nodejs/Jenkinsfile | 32 ------- nodejs/podman/Dockerfile | 43 --------- python/Dockerfile | 22 ----- python/Jenkinsfile | 32 ------- python/podman/Dockerfile | 22 ----- 26 files changed, 87 insertions(+), 1175 deletions(-) delete mode 100644 dotnet/Dockerfile delete mode 100644 dotnet/Jenkinsfile delete mode 100644 dotnet/LICENSE delete mode 100644 go/.gitignore delete mode 100644 go/Dockerfile delete mode 100644 go/Jenkinsfile delete mode 100644 go/LICENSE delete mode 100755 go/hack/install_utils.sh delete mode 100644 go/podman/Dockerfile delete mode 100644 gradle/Dockerfile delete mode 100644 gradle/Jenkinsfile delete mode 100644 gradle/podman/Dockerfile delete mode 100755 gradle/set_java delete mode 100644 maven/Dockerfile delete mode 100644 maven/Jenkinsfile delete mode 100644 maven/LICENSE delete mode 100644 maven/podman/Dockerfile delete mode 100755 maven/set_java delete mode 100644 nodejs/Dockerfile delete mode 100644 nodejs/Jenkinsfile delete mode 100644 nodejs/podman/Dockerfile delete mode 100644 python/Dockerfile delete mode 100644 python/Jenkinsfile delete mode 100644 python/podman/Dockerfile diff --git a/base/Dockerfile b/base/Dockerfile index c12b2c0..479f765 100644 --- a/base/Dockerfile +++ b/base/Dockerfile @@ -4,9 +4,9 @@ FROM ubuntu:24.04 ENV LANG en_US.UTF-8 ENV LANGUAGE en_US:en ENV LC_ALL en_US.UTF-8 -ENV PATH $PATH:/usr/local/bin +ENV PATH $PATH:/usr/local:/usr/local/bin -# Install additional utils not included by default +# Install utils RUN apt-get update && \ apt-get install -y \ ca-certificates \ @@ -32,12 +32,20 @@ RUN apt-get update && \ libssl-dev \ libperl-dev \ zlib1g-dev \ + python3 \ python3-pip \ podman \ openjdk-21-jdk && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* +## Settings for Java +ENV JDK_HOME $(dirname $(dirname $(readlink -f $(which java)))) +ENV JAVA_HOME $JDK_HOME + +# Settings for python +RUN ln -fs $(which python3) /usr/bin/python && ln -fs $(which pip3) /usr/bin/pip + # Install docker CLI RUN install -m 0755 -d /etc/apt/keyrings && \ curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc && \ @@ -65,10 +73,8 @@ RUN curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/s # Install kustomize RUN curl -s "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" | bash -# Set up Sonar Scanner -ENV SONAR_SCANNER_VERSION 7.0.2.4839 - # 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; \ @@ -86,12 +92,86 @@ RUN arch=$(dpkg --print-architecture) && \ 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 .NET +RUN add-apt-repository ppa:dotnet/backports && \ + apt-get update && \ + apt-get install -y dotnet-sdk-9.0 + +ENV PATH $PATH:/root/.nuget/tools:/root/.dotnet/tools + +# Install golang +RUN add-apt-repository ppa:longsleep/golang-backports && \ + apt-get update && \ + apt-get install -y golang-go + +# Settings for golang +ENV GOROOT /usr/local/go +ENV GOPATH /home/jenkins/go +ENV PATH $PATH:/usr/local/go/bin:$GOPATH/bin +RUN mkdir -p $GOPATH/bin && mkdir -p $GOPATH/src && mkdir -p $GOPATH/pkg +# Install sdkman +RUN curl -s "https://get.sdkman.io" | bash + +# Install gradle +ENV GRADLE_VERSION 8.13 +RUN sdk install gradle ${GRADLE_VERSION} + +# 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 +ENV M2_HOME /opt/apache-maven-$MAVEN_VERSION +ENV maven.home $M2_HOME +ENV M2 $M2_HOME/bin +ENV PATH $PATH:$M2:${JAVA_HOME}/bin + +# 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 + +# Install nvm +RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash + +# Download and install Node.js +RUN nvm install 22 +RUN npm -g config set user root +RUN npm i -g watch-cli vsce typescript + +# Install Yarn +RUN npm install --global yarn + +# Settings for podman RUN mkdir -p /etc/containers COPY *.conf /etc/containers/ - VOLUME /var/lib/containers +# Verify installations +RUN docker --version && \ + podman --version && \ + java --version && \ + helm version && \ + kubectl version --client --short && \ + ks version && \ + sonar-scanner --version && \ + dotnet --version && \ + go version && \ + gradle --version && \ + mvn --version && \ + ant --version && \ + nvm --version && \ + nvm current && \ + npm --version && \ + node --version && \ + yarn --version && \ + python --version && \ + pip --version && \ + kustomize version \ + # Set working directory WORKDIR /home/jenkins diff --git a/base/README.md b/base/README.md index fdcbc99..8bb4e5b 100644 --- a/base/README.md +++ b/base/README.md @@ -1,2 +1,2 @@ -Base image with docker and podman +Base image with common sdks and utilities diff --git a/dotnet/Dockerfile b/dotnet/Dockerfile deleted file mode 100644 index 6d7f80b..0000000 --- a/dotnet/Dockerfile +++ /dev/null @@ -1,15 +0,0 @@ -FROM kubespheredev/builder-base:v3.1.0 - -RUN yum install -y krb5-libs libicu openssl-libs compat-openssl10 libgdiplus libstdc++-devel devtoolset-7-gcc devtoolset-7-gcc-c++ devtoolset-7-binutils - -RUN wget https://dot.net/v1/dotnet-install.sh - -RUN chmod a+x dotnet-install.sh - -RUN sh dotnet-install.sh -c 5.0 --install-dir /usr/share/dotnet5 - -RUN ln -s /usr/share/dotnet5/dotnet /usr/bin/dotnet - -ENV PATH $PATH:/root/.nuget/tools:/root/.dotnet/tools - -CMD ["dotnet", "--version"] diff --git a/dotnet/Jenkinsfile b/dotnet/Jenkinsfile deleted file mode 100644 index fbf69cd..0000000 --- a/dotnet/Jenkinsfile +++ /dev/null @@ -1,32 +0,0 @@ -pipeline { - agent { - node { - label 'base' - } - - } - stages { - stage('build and tag image') { - steps { - container('base') { - sh '''docker build -t kubespheredev/builder-dotnet . -docker tag kubespheredev/builder-dotnet kubespheredev/builder-dotnet:2.1.0''' - } - - } - } - stage('docker push') { - when{ - branch 'master' - } - steps { - container('base') { - withCredentials([usernamePassword(passwordVariable : 'DOCKER_PASSWORD' ,usernameVariable : 'DOCKER_USERNAME' ,credentialsId : 'dockerhub-id' ,)]) { - sh 'echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin' - } - sh 'docker push kubespheredev/builder-dotnet' - } - } - } - } -} diff --git a/dotnet/LICENSE b/dotnet/LICENSE deleted file mode 100644 index 261eeb9..0000000 --- a/dotnet/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/go/.gitignore b/go/.gitignore deleted file mode 100644 index 173454b..0000000 --- a/go/.gitignore +++ /dev/null @@ -1,9 +0,0 @@ -# Created by .ignore support plugin (hsz.mobi) -### Example user template template -### Example user template - -# IntelliJ project files -.idea -*.iml -out -gen diff --git a/go/Dockerfile b/go/Dockerfile deleted file mode 100644 index cd374e9..0000000 --- a/go/Dockerfile +++ /dev/null @@ -1,19 +0,0 @@ -FROM kubespheredev/builder-base:v3.1.0 - -RUN yum -y groupinstall 'Development Tools' && yum -y clean all --enablerepo='*' - -ARG GOLANG_VERSION 1.12.10 -ENV GOLANG_VERSION $GOLANG_VERSION - -ENV PATH $PATH:/usr/local/go/bin -ENV PATH $PATH:/usr/local/ -ENV GOROOT /usr/local/go -ENV GOPATH=/home/jenkins/go -ENV PATH $PATH:$GOPATH/bin - -COPY ./ ./ -RUN ./hack/install_utils.sh && rm -rf ./* - -RUN mkdir -p $GOPATH/bin && mkdir -p $GOPATH/src && mkdir -p $GOPATH/pkg - -CMD ["go","version"] diff --git a/go/Jenkinsfile b/go/Jenkinsfile deleted file mode 100644 index 9332b89..0000000 --- a/go/Jenkinsfile +++ /dev/null @@ -1,32 +0,0 @@ -pipeline { - agent { - node { - label 'base' - } - - } - stages { - stage('build and tag image') { - steps { - container('base') { - sh '''docker build -t kubespheredev/builder-go . -docker tag kubespheredev/builder-go kubespheredev/builder-go:2.1.0''' - } - - } - } - stage('docker push') { - when{ - branch 'master' - } - steps { - container('base') { - withCredentials([usernamePassword(passwordVariable : 'DOCKER_PASSWORD' ,usernameVariable : 'DOCKER_USERNAME' ,credentialsId : 'dockerhub-id' ,)]) { - sh 'echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin' - } - sh 'docker push kubespheredev/builder-go' - } - } - } - } -} diff --git a/go/LICENSE b/go/LICENSE deleted file mode 100644 index 261eeb9..0000000 --- a/go/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/go/hack/install_utils.sh b/go/hack/install_utils.sh deleted file mode 100755 index a31c771..0000000 --- a/go/hack/install_utils.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env bash - - -ARCH=$(uname -m) - -echo $ARCH - -# GOLANG -if [[ ${ARCH} == 'x86_64' ]]; then - wget https://golang.org/dl/go$GOLANG_VERSION.linux-amd64.tar.gz && \ - tar -C /usr/local -xzf go$GOLANG_VERSION.linux-amd64.tar.gz && \ - rm go${GOLANG_VERSION}.linux-amd64.tar.gz -elif [[ ${ARCH} == 'aarch64' ]] -then - wget https://golang.org/dl/go$GOLANG_VERSION.linux-arm64.tar.gz && \ - tar -C /usr/local -xzf go$GOLANG_VERSION.linux-arm64.tar.gz && \ - rm go${GOLANG_VERSION}.linux-arm64.tar.gz -else - echo "do not support this arch" - exit 1 -fi diff --git a/go/podman/Dockerfile b/go/podman/Dockerfile deleted file mode 100644 index c4ffea5..0000000 --- a/go/podman/Dockerfile +++ /dev/null @@ -1,19 +0,0 @@ -FROM kubespheredev/builder-base:v3.1.0-podman - -RUN yum -y groupinstall 'Development Tools' && yum -y clean all --enablerepo='*' - -ARG GOLANG_VERSION 1.12.10 -ENV GOLANG_VERSION $GOLANG_VERSION - -ENV PATH $PATH:/usr/local/go/bin -ENV PATH $PATH:/usr/local/ -ENV GOROOT /usr/local/go -ENV GOPATH=/home/jenkins/go -ENV PATH $PATH:$GOPATH/bin - -COPY ./ ./ -RUN ./hack/install_utils.sh && rm -rf ./* - -RUN mkdir -p $GOPATH/bin && mkdir -p $GOPATH/src && mkdir -p $GOPATH/pkg - -CMD ["go","version"] diff --git a/gradle/Dockerfile b/gradle/Dockerfile deleted file mode 100644 index 1299846..0000000 --- a/gradle/Dockerfile +++ /dev/null @@ -1,23 +0,0 @@ -FROM kubespheredev/builder-base:v3.1.0 - -# java -ENV JAVA_VERSIOIN 1.8.0 -RUN yum install -y java-${JAVA_VERSIOIN}-openjdk-devel java-${JAVA_VERSIOIN}-openjdk-devel.i686 && \ - yum -y clean all - -# gradle6 -ENV GRADLE_VERSION 6.9.1 -ENV GRADLE_HOME /usr/local/gradle-${GRADLE_VERSION} -ENV PATH ${GRADLE_HOME}/bin:$PATH - -RUN curl -fSL https://services.gradle.org/distributions/gradle-${GRADLE_VERSION}-bin.zip -o gradle.zip && \ - echo "$(curl -sLf https://services.gradle.org/distributions/gradle-${GRADLE_VERSION}-bin.zip.sha256) gradle.zip" | sha256sum --check && \ - unzip -q gradle.zip -d /usr/local && \ - rm -f gradle.zip - -# Set JDK to be 32bit -COPY set_java $GRADLE_HOME -RUN $GRADLE_HOME/set_java && \ - rm -f $GRADLE_HOME/set_java - -CMD ["gradle","--version"] diff --git a/gradle/Jenkinsfile b/gradle/Jenkinsfile deleted file mode 100644 index b0cd3d4..0000000 --- a/gradle/Jenkinsfile +++ /dev/null @@ -1,32 +0,0 @@ -pipeline { - agent { - node { - label 'base' - } - - } - stages { - stage('build and tag image') { - steps { - container('base') { - sh '''docker build -t kubespheredev/builder-gradle . -docker tag kubespheredev/builder-gradle kubespheredev/builder-gradle:2.1.0''' - } - - } - } - stage('docker push') { - when{ - branch 'master' - } - steps { - container('base') { - withCredentials([usernamePassword(passwordVariable : 'DOCKER_PASSWORD' ,usernameVariable : 'DOCKER_USERNAME' ,credentialsId : 'dockerhub-id' ,)]) { - sh 'echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin' - } - sh 'docker push kubespheredev/builder-gradle' - } - } - } - } -} diff --git a/gradle/podman/Dockerfile b/gradle/podman/Dockerfile deleted file mode 100644 index d03be55..0000000 --- a/gradle/podman/Dockerfile +++ /dev/null @@ -1,13 +0,0 @@ -FROM kubespheredev/builder-base:v3.1.0-podman - -# gradle6 -ENV GRADLE_VERSION=6.9.1 -ENV GRADLE_HOME /usr/local/gradle-${GRADLE_VERSION} -ENV PATH ${GRADLE_HOME}/bin:$PATH - -RUN curl -fSL https://services.gradle.org/distributions/gradle-${GRADLE_VERSION}-bin.zip -o gradle.zip && \ - echo "$(curl -sLf https://services.gradle.org/distributions/gradle-${GRADLE_VERSION}-bin.zip.sha256) gradle.zip" | sha256sum --check && \ - unzip -q gradle.zip -d /usr/local && \ - rm -f gradle.zip - -CMD ["gradle","--version"] diff --git a/gradle/set_java b/gradle/set_java deleted file mode 100755 index f309778..0000000 --- a/gradle/set_java +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash -# credit https://github.com/jerboaa from https://github.com/fabric8io-images/maven-builder/blob/d81dedbc298dee7e071ac2bc1e0050ae7ee1e5aa/set_java - -ARCH=$(uname -m) -echo $ARCH - -if [[ ${ARCH} == 'x86_64' ]]; then - JAVA_32=$(alternatives --display java | grep family | grep i386 | cut -d' ' -f1) - alternatives --set java ${JAVA_32} - JAVAC_32=$(alternatives --display javac | grep family | grep i386 | cut -d' ' -f1) - # Maven actually uses javac, not java - alternatives --set javac ${JAVAC_32} - exit $? -fi diff --git a/maven/Dockerfile b/maven/Dockerfile deleted file mode 100644 index 14c7924..0000000 --- a/maven/Dockerfile +++ /dev/null @@ -1,48 +0,0 @@ -FROM kubespheredev/builder-base:v3.1.0 - -ARG JDK_VERSION 1.8.0 -ARG JDK_HOME /usr/lib/jvm/java-${JDK_VERSION}-openjdk - -# java -ENV JAVA_VERSION $JDK_VERSION - -RUN if [ "x${JAVA_VERSION}" = "x17" ]; then \ - ARCH= && uArch="$(uname -m)" \ - && case "${uArch##*-}" in \ - x86_64) ARCH='x64';; \ - aarch64) ARCH='aarch64';; \ - *) echo "unsupported architecture"; exit 1 ;; \ - esac \ - && wget https://download.oracle.com/java/${JAVA_VERSION}/latest/jdk-${JAVA_VERSION}_linux-${ARCH}_bin.rpm \ - && rpm -ivh jdk-${JAVA_VERSION}_linux-${ARCH}_bin.rpm; \ - else \ - yum install -y java-${JAVA_VERSION}-openjdk-devel java-${JAVA_VERSION}-openjdk-devel.i686; \ - fi -# maven -ENV MAVEN_VERSION 3.5.3 -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 -ENV M2_HOME /opt/apache-maven-$MAVEN_VERSION -ENV JAVA_HOME $JDK_HOME -ENV maven.home $M2_HOME -ENV M2 $M2_HOME/bin -ENV PATH $M2:$PATH:JAVA_HOME/bin - -# ant -ENV ANT_VERSION 1.10.7 -RUN cd && \ - 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}:/opt/ant/bin - -# Set JDK to be 32bit -COPY set_java $M2 -RUN if [ "x${JAVA_VERSION}" = "x17" ]; then \ - rm $M2/set_java; \ - else \ - $M2/set_java && rm $M2/set_java; \ - fi - -CMD ["mvn","-version"] diff --git a/maven/Jenkinsfile b/maven/Jenkinsfile deleted file mode 100644 index 266ed5c..0000000 --- a/maven/Jenkinsfile +++ /dev/null @@ -1,32 +0,0 @@ -pipeline { - agent { - node { - label 'base' - } - - } - stages { - stage('build and tag image') { - steps { - container('base') { - sh '''docker build -t kubespheredev/builder-maven . -docker tag kubespheredev/builder-maven kubespheredev/builder-maven:2.1.0''' - } - - } - } - stage('docker push') { - when{ - branch 'master' - } - steps { - container('base') { - withCredentials([usernamePassword(passwordVariable : 'DOCKER_PASSWORD' ,usernameVariable : 'DOCKER_USERNAME' ,credentialsId : 'dockerhub-id' ,)]) { - sh 'echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin' - } - sh 'docker push kubespheredev/builder-maven' - } - } - } - } -} diff --git a/maven/LICENSE b/maven/LICENSE deleted file mode 100644 index 261eeb9..0000000 --- a/maven/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/maven/podman/Dockerfile b/maven/podman/Dockerfile deleted file mode 100644 index 771eec0..0000000 --- a/maven/podman/Dockerfile +++ /dev/null @@ -1,48 +0,0 @@ -FROM kubespheredev/builder-base:v3.1.0-podman - -ARG JDK_VERSION 1.8.0 -ARG JDK_HOME /usr/lib/jvm/java-${JDK_VERSION}-openjdk - -# java -ENV JAVA_VERSION $JDK_VERSION - -RUN if [ "x${JAVA_VERSION}" = "x17" ]; then \ - ARCH= && uArch="$(uname -m)" \ - && case "${uArch##*-}" in \ - x86_64) ARCH='x64';; \ - aarch64) ARCH='aarch64';; \ - *) echo "unsupported architecture"; exit 1 ;; \ - esac \ - && wget https://download.oracle.com/java/${JAVA_VERSION}/latest/jdk-${JAVA_VERSION}_linux-${ARCH}_bin.rpm \ - && rpm -ivh jdk-${JAVA_VERSION}_linux-${ARCH}_bin.rpm; \ - else \ - yum install -y java-${JAVA_VERSION}-openjdk-devel java-${JAVA_VERSION}-openjdk-devel.i686; \ - fi -# maven -ENV MAVEN_VERSION 3.5.3 -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 -ENV M2_HOME /opt/apache-maven-$MAVEN_VERSION -ENV JAVA_HOME $JDK_HOME -ENV maven.home $M2_HOME -ENV M2 $M2_HOME/bin -ENV PATH $M2:$PATH:JAVA_HOME/bin - -# ant -ENV ANT_VERSION 1.10.7 -RUN cd && \ - 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}:/opt/ant/bin - -# Set JDK to be 32bit -COPY set_java $M2 -RUN if [ "x${JAVA_VERSION}" = "x17" ]; then \ - rm $M2/set_java; \ - else \ - $M2/set_java && rm $M2/set_java; \ - fi - -CMD ["mvn","-version"] diff --git a/maven/set_java b/maven/set_java deleted file mode 100755 index f309778..0000000 --- a/maven/set_java +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash -# credit https://github.com/jerboaa from https://github.com/fabric8io-images/maven-builder/blob/d81dedbc298dee7e071ac2bc1e0050ae7ee1e5aa/set_java - -ARCH=$(uname -m) -echo $ARCH - -if [[ ${ARCH} == 'x86_64' ]]; then - JAVA_32=$(alternatives --display java | grep family | grep i386 | cut -d' ' -f1) - alternatives --set java ${JAVA_32} - JAVAC_32=$(alternatives --display javac | grep family | grep i386 | cut -d' ' -f1) - # Maven actually uses javac, not java - alternatives --set javac ${JAVAC_32} - exit $? -fi diff --git a/nodejs/Dockerfile b/nodejs/Dockerfile deleted file mode 100644 index 183fe0f..0000000 --- a/nodejs/Dockerfile +++ /dev/null @@ -1,43 +0,0 @@ -FROM kubespheredev/builder-base:v3.1.0 - -ENV NODE_VERSION 10.16.3 - -RUN ARCH= && uArch="$(uname -m)" \ - && case "${uArch##*-}" in \ - x86_64) ARCH='x64';; \ - aarch64) ARCH='arm64';; \ - *) echo "unsupported architecture"; exit 1 ;; \ - esac \ - # gpg keys listed at https://github.com/nodejs/node#release-keys - && set -ex \ - && for key in \ - 4ED778F539E3634C779C87C6D7062848A1AB005C \ - 141F07595B7B3FFE74309A937405533BE57C7D57 \ - 74F12602B6F1C4E913FAA37AD3A89613643B6201 \ - 61FC681DFB92A079F1685E77973F295594EC4689 \ - 8FCCA13FEF1D0C2E91008E09770F7A9A5AE15600 \ - C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8 \ - 890C08DB8579162FEE0DF9DB8BEAB4DFCF555EF4 \ - C82FA3AE1CBEDC6BE46B9360C43CEC45C17AB93C \ - 108F52B48DB57BB0CC439B2997B01419BD92F80A \ - ; do \ - gpg --batch --keyserver sks.srv.dumain.com --recv-keys "$key"; \ - done \ - && curl -fsSLO --compressed "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-$ARCH.tar.xz" \ - && curl -fsSLO https://nodejs.org/dist/v$NODE_VERSION/SHASUMS256.txt \ - && grep " node-v$NODE_VERSION-linux-$ARCH.tar.xz\$" SHASUMS256.txt | sha256sum -c - \ - && tar -xJf "node-v$NODE_VERSION-linux-$ARCH.tar.xz" -C /usr/local --strip-components=1 --no-same-owner \ - && rm "node-v$NODE_VERSION-linux-$ARCH.tar.xz" SHASUMS256.txt \ - && ln -s /usr/local/bin/node /usr/local/bin/nodejs \ - && yum install -y nodejs gcc-c++ make bzip2 GConf2 gtk2 chromedriver chromium xorg-x11-server-Xvfb - -RUN npm -g config set user root -RUN npm i -g watch-cli vsce typescript - -# Yarn -ENV YARN_VERSION 1.16.0 -RUN curl -f -L -o /tmp/yarn.tgz https://github.com/yarnpkg/yarn/releases/download/v${YARN_VERSION}/yarn-v${YARN_VERSION}.tar.gz && \ - tar xf /tmp/yarn.tgz && \ - mv yarn-v${YARN_VERSION} /opt/yarn && \ - ln -s /opt/yarn/bin/yarn /usr/local/bin/yarn && \ - yarn config set cache-folder /root/.yarn diff --git a/nodejs/Jenkinsfile b/nodejs/Jenkinsfile deleted file mode 100644 index aa753b9..0000000 --- a/nodejs/Jenkinsfile +++ /dev/null @@ -1,32 +0,0 @@ -pipeline { - agent { - node { - label 'base' - } - - } - stages { - stage('build and tag image') { - steps { - container('base') { - sh '''docker build -t kubespheredev/builder-nodejs . -docker tag kubespheredev/builder-nodejs kubespheredev/builder-nodejs:2.1.0''' - } - - } - } - stage('docker push') { - when{ - branch 'master' - } - steps { - container('base') { - withCredentials([usernamePassword(passwordVariable : 'DOCKER_PASSWORD' ,usernameVariable : 'DOCKER_USERNAME' ,credentialsId : 'dockerhub-id' ,)]) { - sh 'echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin' - } - sh 'docker push kubespheredev/builder-nodejs' - } - } - } - } -} diff --git a/nodejs/podman/Dockerfile b/nodejs/podman/Dockerfile deleted file mode 100644 index a91fb7d..0000000 --- a/nodejs/podman/Dockerfile +++ /dev/null @@ -1,43 +0,0 @@ -FROM kubespheredev/builder-base:v3.1.0-podman - -ENV NODE_VERSION 10.16.3 - -RUN ARCH= && uArch="$(uname -m)" \ - && case "${uArch##*-}" in \ - x86_64) ARCH='x64';; \ - aarch64) ARCH='arm64';; \ - *) echo "unsupported architecture"; exit 1 ;; \ - esac \ - # gpg keys listed at https://github.com/nodejs/node#release-keys - && set -ex \ - && for key in \ - 4ED778F539E3634C779C87C6D7062848A1AB005C \ - 141F07595B7B3FFE74309A937405533BE57C7D57 \ - 74F12602B6F1C4E913FAA37AD3A89613643B6201 \ - 61FC681DFB92A079F1685E77973F295594EC4689 \ - 8FCCA13FEF1D0C2E91008E09770F7A9A5AE15600 \ - C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8 \ - 890C08DB8579162FEE0DF9DB8BEAB4DFCF555EF4 \ - C82FA3AE1CBEDC6BE46B9360C43CEC45C17AB93C \ - 108F52B48DB57BB0CC439B2997B01419BD92F80A \ - ; do \ - gpg --batch --keyserver sks.srv.dumain.com --recv-keys "$key"; \ - done \ - && curl -fsSLO --compressed "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-$ARCH.tar.xz" \ - && curl -fsSLO https://nodejs.org/dist/v$NODE_VERSION/SHASUMS256.txt \ - && grep " node-v$NODE_VERSION-linux-$ARCH.tar.xz\$" SHASUMS256.txt | sha256sum -c - \ - && tar -xJf "node-v$NODE_VERSION-linux-$ARCH.tar.xz" -C /usr/local --strip-components=1 --no-same-owner \ - && rm "node-v$NODE_VERSION-linux-$ARCH.tar.xz" SHASUMS256.txt \ - && ln -s /usr/local/bin/node /usr/local/bin/nodejs \ - && yum install -y nodejs gcc-c++ make bzip2 GConf2 gtk2 chromedriver chromium xorg-x11-server-Xvfb - -RUN npm -g config set user root -RUN npm i -g watch-cli vsce typescript - -# Yarn -ENV YARN_VERSION 1.16.0 -RUN curl -f -L -o /tmp/yarn.tgz https://github.com/yarnpkg/yarn/releases/download/v${YARN_VERSION}/yarn-v${YARN_VERSION}.tar.gz && \ - tar xf /tmp/yarn.tgz && \ - mv yarn-v${YARN_VERSION} /opt/yarn && \ - ln -s /opt/yarn/bin/yarn /usr/local/bin/yarn && \ - yarn config set cache-folder /root/.yarn diff --git a/python/Dockerfile b/python/Dockerfile deleted file mode 100644 index bbe20c1..0000000 --- a/python/Dockerfile +++ /dev/null @@ -1,22 +0,0 @@ -FROM kubespheredev/builder-base:v3.1.0 - -# python3 -ENV PYTHON_VERSION=3.7.11 -RUN yum -y install bzip2-devel libffi-devel libsqlite3x-devel && \ - curl -fSL https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tgz -o /usr/src/Python-${PYTHON_VERSION}.tgz && \ - tar xzf /usr/src/Python-${PYTHON_VERSION}.tgz -C /usr/src/ --no-same-owner && \ - cd /usr/src/Python-${PYTHON_VERSION} && \ - ./configure --enable-optimizations --with-ensurepip=install --enable-loadable-sqlite-extensions && \ - make altinstall -j 2 && \ - cd ../ && \ - rm -rf /usr/src/Python-${PYTHON_VERSION}.tgz /usr/src/Python-${PYTHON_VERSION} && \ - ln -fs /usr/local/bin/python3.7 /usr/bin/python && \ - ln -fs /usr/local/bin/python3.7 /usr/bin/python3 && \ - ln -fs /usr/local/bin/pip3.7 /usr/bin/pip && \ - python3 -m pip install --upgrade pip && \ - sed -e 's|^#!/usr/bin/python|#!/usr/bin/python2.7|g' -i.bak /usr/bin/yum && \ - sed -e 's|^#! /usr/bin/python|#! /usr/bin/python2.7|g' -i.bak /usr/libexec/urlgrabber-ext-down && \ - yum -y remove bzip2-devel libffi-devel libsqlite3x-devel && \ - yum -y clean all - -CMD ["python","--version"] diff --git a/python/Jenkinsfile b/python/Jenkinsfile deleted file mode 100644 index 67694f2..0000000 --- a/python/Jenkinsfile +++ /dev/null @@ -1,32 +0,0 @@ -pipeline { - agent { - node { - label 'base' - } - - } - stages { - stage('build and tag image') { - steps { - container('base') { - sh '''docker build -t kubespheredev/builder-python . -docker tag kubespheredev/builder-python kubespheredev/builder-python:2.1.0''' - } - - } - } - stage('docker push') { - when{ - branch 'master' - } - steps { - container('base') { - withCredentials([usernamePassword(passwordVariable : 'DOCKER_PASSWORD' ,usernameVariable : 'DOCKER_USERNAME' ,credentialsId : 'dockerhub-id' ,)]) { - sh 'echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin' - } - sh 'docker push kubespheredev/builder-python' - } - } - } - } -} diff --git a/python/podman/Dockerfile b/python/podman/Dockerfile deleted file mode 100644 index 112bda2..0000000 --- a/python/podman/Dockerfile +++ /dev/null @@ -1,22 +0,0 @@ -FROM kubespheredev/builder-base:v3.1.0-podman - -# python3 -ENV PYTHON_VERSION=3.7.11 -RUN yum -y install bzip2-devel libffi-devel libsqlite3x-devel && \ - curl -fSL https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tgz -o /usr/src/Python-${PYTHON_VERSION}.tgz && \ - tar xzf /usr/src/Python-${PYTHON_VERSION}.tgz -C /usr/src/ --no-same-owner && \ - cd /usr/src/Python-${PYTHON_VERSION} && \ - ./configure --enable-optimizations --with-ensurepip=install --enable-loadable-sqlite-extensions && \ - make altinstall -j 2 && \ - cd ../ && \ - rm -rf /usr/src/Python-${PYTHON_VERSION}.tgz /usr/src/Python-${PYTHON_VERSION} && \ - ln -fs /usr/local/bin/python3.7 /usr/bin/python && \ - ln -fs /usr/local/bin/python3.7 /usr/bin/python3 && \ - ln -fs /usr/local/bin/pip3.7 /usr/bin/pip && \ - python3 -m pip install --upgrade pip && \ - sed -e 's|^#!/usr/bin/python|#!/usr/bin/python2.7|g' -i.bak /usr/bin/yum && \ - sed -e 's|^#! /usr/bin/python|#! /usr/bin/python2.7|g' -i.bak /usr/libexec/urlgrabber-ext-down && \ - yum -y remove bzip2-devel libffi-devel libsqlite3x-devel && \ - yum -y clean all - -CMD ["python","--version"] From d3007ab0b16a62032b33bbe9484296c3214188f7 Mon Sep 17 00:00:00 2001 From: stoneshi-yunify Date: Fri, 7 Mar 2025 15:57:18 +0800 Subject: [PATCH 17/59] fix dockerfile Signed-off-by: stoneshi-yunify --- base/Dockerfile | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/base/Dockerfile b/base/Dockerfile index 479f765..bd5b538 100644 --- a/base/Dockerfile +++ b/base/Dockerfile @@ -6,6 +6,9 @@ ENV LANGUAGE en_US:en ENV LC_ALL en_US.UTF-8 ENV PATH $PATH:/usr/local:/usr/local/bin +# Set Bash as the default shell +RUN chsh -s /bin/bash + # Install utils RUN apt-get update && \ apt-get install -y \ @@ -35,9 +38,8 @@ RUN apt-get update && \ python3 \ python3-pip \ podman \ - openjdk-21-jdk && \ - apt-get clean && \ - rm -rf /var/lib/apt/lists/* + software-properties-common \ + openjdk-21-jdk ## Settings for Java ENV JDK_HOME $(dirname $(dirname $(readlink -f $(which java)))) @@ -55,9 +57,7 @@ RUN install -m 0755 -d /etc/apt/keyrings && \ $(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}") stable" | \ tee /etc/apt/sources.list.d/docker.list > /dev/null && \ apt-get update && \ - apt-get install -y docker-ce-cli docker-buildx-plugin docker-compose-plugin && \ - apt-get clean && \ - rm -rf /var/lib/apt/lists/* + apt-get install -y docker-ce-cli docker-buildx-plugin docker-compose-plugin # Install helm RUN curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 && \ @@ -172,6 +172,10 @@ RUN docker --version && \ pip --version && \ kustomize version \ +# Clean up +RUN apt-get clean && \ + rm -rf /var/lib/apt/lists/* + # Set working directory WORKDIR /home/jenkins From dcf2f0d8845321410c4e3e09acf04ea2490122c7 Mon Sep 17 00:00:00 2001 From: stoneshi-yunify Date: Fri, 7 Mar 2025 16:12:47 +0800 Subject: [PATCH 18/59] fix dockerfile Signed-off-by: stoneshi-yunify --- base/Dockerfile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/base/Dockerfile b/base/Dockerfile index bd5b538..09156df 100644 --- a/base/Dockerfile +++ b/base/Dockerfile @@ -86,7 +86,7 @@ RUN arch=$(dpkg --print-architecture) && \ 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 && \ - ln -s /opt/sonar-scanner-$SONAR_SCANNER_VERSION-${TARGET_ARCH}/bin/sonar-scanner /usr/local/bin/sonar-scanner + ln -s /opt/sonar-scanner-${SONAR_SCANNER_VERSION}-${TARGET_ARCH}/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 && \ @@ -173,8 +173,7 @@ RUN docker --version && \ kustomize version \ # Clean up -RUN apt-get clean && \ - rm -rf /var/lib/apt/lists/* +RUN apt-get clean && rm -rf /var/lib/apt/lists/* # Set working directory WORKDIR /home/jenkins From 373c76d1ad41f4aa63d09fbd17044e9ed8ec4c59 Mon Sep 17 00:00:00 2001 From: stoneshi-yunify Date: Fri, 7 Mar 2025 16:31:07 +0800 Subject: [PATCH 19/59] fix dockerfile Signed-off-by: stoneshi-yunify --- base/Dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/base/Dockerfile b/base/Dockerfile index 09156df..493f2d2 100644 --- a/base/Dockerfile +++ b/base/Dockerfile @@ -9,6 +9,9 @@ ENV PATH $PATH:/usr/local:/usr/local/bin # Set Bash as the default shell RUN chsh -s /bin/bash +# Set Bash as the default shell +SHELL ["/bin/bash", "-c"] + # Install utils RUN apt-get update && \ apt-get install -y \ From 8540b187299547eab8f78ac6fa49387b1c18f441 Mon Sep 17 00:00:00 2001 From: stoneshi-yunify Date: Fri, 7 Mar 2025 16:34:29 +0800 Subject: [PATCH 20/59] fix dockerfile Signed-off-by: stoneshi-yunify --- base/Dockerfile | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/base/Dockerfile b/base/Dockerfile index 493f2d2..639476a 100644 --- a/base/Dockerfile +++ b/base/Dockerfile @@ -8,8 +8,6 @@ ENV PATH $PATH:/usr/local:/usr/local/bin # Set Bash as the default shell RUN chsh -s /bin/bash - -# Set Bash as the default shell SHELL ["/bin/bash", "-c"] # Install utils @@ -173,10 +171,11 @@ RUN docker --version && \ yarn --version && \ python --version && \ pip --version && \ - kustomize version \ + kustomize version # Clean up -RUN apt-get clean && rm -rf /var/lib/apt/lists/* +RUN apt-get clean && \ + rm -rf /var/lib/apt/lists/* # Set working directory WORKDIR /home/jenkins From 3c953dfde64a7cb9144a58f5168f3902941cec1a Mon Sep 17 00:00:00 2001 From: stoneshi-yunify Date: Fri, 7 Mar 2025 16:59:54 +0800 Subject: [PATCH 21/59] fix dockerfile Signed-off-by: stoneshi-yunify --- base/Dockerfile | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/base/Dockerfile b/base/Dockerfile index 639476a..620bc3b 100644 --- a/base/Dockerfile +++ b/base/Dockerfile @@ -1,15 +1,14 @@ FROM ubuntu:24.04 -# Set the locale(en_US.UTF-8) -ENV LANG en_US.UTF-8 -ENV LANGUAGE en_US:en -ENV LC_ALL en_US.UTF-8 -ENV PATH $PATH:/usr/local:/usr/local/bin +# Set PATH +ENV PATH=$PATH:/usr/local:/usr/local/bin # Set Bash as the default shell RUN chsh -s /bin/bash SHELL ["/bin/bash", "-c"] +WORKDIR /root + # Install utils RUN apt-get update && \ apt-get install -y \ @@ -43,8 +42,8 @@ RUN apt-get update && \ openjdk-21-jdk ## Settings for Java -ENV JDK_HOME $(dirname $(dirname $(readlink -f $(which java)))) -ENV JAVA_HOME $JDK_HOME +ENV JDK_HOME="$(dirname $(dirname $(readlink -f $(which java))))" +ENV JAVA_HOME=$JDK_HOME # Settings for python RUN ln -fs $(which python3) /usr/bin/python && ln -fs $(which pip3) /usr/bin/pip @@ -75,7 +74,7 @@ RUN curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/s RUN 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 +ENV SONAR_SCANNER_VERSION=7.0.2.4839 RUN arch=$(dpkg --print-architecture) && \ if [ $arch = "amd64" ]; then \ TARGET_ARCH=linux-x64; \ @@ -98,7 +97,7 @@ RUN add-apt-repository ppa:dotnet/backports && \ apt-get update && \ apt-get install -y dotnet-sdk-9.0 -ENV PATH $PATH:/root/.nuget/tools:/root/.dotnet/tools +ENV PATH=$PATH:/root/.nuget/tools:/root/.dotnet/tools # Install golang RUN add-apt-repository ppa:longsleep/golang-backports && \ @@ -106,34 +105,35 @@ RUN add-apt-repository ppa:longsleep/golang-backports && \ apt-get install -y golang-go # Settings for golang -ENV GOROOT /usr/local/go -ENV GOPATH /home/jenkins/go -ENV PATH $PATH:/usr/local/go/bin:$GOPATH/bin +ENV GOROOT=/usr/local/go +ENV GOPATH=/home/jenkins/go +ENV PATH=$PATH:/usr/local/go/bin:$GOPATH/bin RUN mkdir -p $GOPATH/bin && mkdir -p $GOPATH/src && mkdir -p $GOPATH/pkg # Install sdkman RUN curl -s "https://get.sdkman.io" | bash # Install gradle -ENV GRADLE_VERSION 8.13 -RUN sdk install gradle ${GRADLE_VERSION} +ENV GRADLE_VERSION=8.13 +RUN source "/root/.sdkman/bin/sdkman-init.sh" && \ + sdk install gradle ${GRADLE_VERSION} # Install Maven -ENV MAVEN_VERSION 3.9.9 +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 -ENV M2_HOME /opt/apache-maven-$MAVEN_VERSION -ENV maven.home $M2_HOME -ENV M2 $M2_HOME/bin -ENV PATH $PATH:$M2:${JAVA_HOME}/bin +ENV M2_HOME=/opt/apache-maven-$MAVEN_VERSION +ENV maven.home=$M2_HOME +ENV M2=$M2_HOME/bin +ENV PATH=$PATH:$M2:${JAVA_HOME}/bin # Install ant -ENV ANT_VERSION 1.10.15 +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 +ENV ANT_HOME=/opt/ant +ENV PATH=${PATH}:${ANT_HOME}/bin # Install nvm RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash From 82c82631d1c2849c54c328d1ddf2e1ac79aed47f Mon Sep 17 00:00:00 2001 From: stoneshi-yunify Date: Fri, 7 Mar 2025 17:06:32 +0800 Subject: [PATCH 22/59] fix dockerfile Signed-off-by: stoneshi-yunify --- base/Dockerfile | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/base/Dockerfile b/base/Dockerfile index 620bc3b..a78b0f2 100644 --- a/base/Dockerfile +++ b/base/Dockerfile @@ -92,13 +92,6 @@ RUN arch=$(dpkg --print-architecture) && \ 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 .NET -RUN add-apt-repository ppa:dotnet/backports && \ - apt-get update && \ - apt-get install -y dotnet-sdk-9.0 - -ENV PATH=$PATH:/root/.nuget/tools:/root/.dotnet/tools - # Install golang RUN add-apt-repository ppa:longsleep/golang-backports && \ apt-get update && \ @@ -146,6 +139,13 @@ RUN npm i -g watch-cli vsce typescript # Install Yarn RUN npm install --global yarn +# Install .NET +RUN add-apt-repository ppa:dotnet/backports && \ + apt-get update && \ + apt-get install -y dotnet-sdk-9.0 + +ENV PATH=$PATH:/root/.nuget/tools:/root/.dotnet/tools + # Settings for podman RUN mkdir -p /etc/containers COPY *.conf /etc/containers/ From 4e20e0d8d2d4ded307c9a9c27a6e492fdaa1623a Mon Sep 17 00:00:00 2001 From: stoneshi-yunify Date: Fri, 7 Mar 2025 17:25:45 +0800 Subject: [PATCH 23/59] fix dockerfile Signed-off-by: stoneshi-yunify --- base/Dockerfile | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/base/Dockerfile b/base/Dockerfile index a78b0f2..109861a 100644 --- a/base/Dockerfile +++ b/base/Dockerfile @@ -1,5 +1,7 @@ FROM ubuntu:24.04 +WORKDIR /root + # Set PATH ENV PATH=$PATH:/usr/local:/usr/local/bin @@ -7,7 +9,10 @@ ENV PATH=$PATH:/usr/local:/usr/local/bin RUN chsh -s /bin/bash SHELL ["/bin/bash", "-c"] -WORKDIR /root +# Create a script file sourced by both interactive and non-interactive bash shells +ENV BASH_ENV=/root/.bash_env +RUN touch "${BASH_ENV}" +RUN echo '. "${BASH_ENV}"' >> /root/.bashrc # Install utils RUN apt-get update && \ @@ -129,7 +134,8 @@ ENV ANT_HOME=/opt/ant ENV PATH=${PATH}:${ANT_HOME}/bin # Install nvm -RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash +RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | PROFILE="${BASH_ENV}" bash +RUN echo node > .nvmrc # Download and install Node.js RUN nvm install 22 From a6d0787f060e1a96172c939e6c9207ee351173ef Mon Sep 17 00:00:00 2001 From: stoneshi-yunify Date: Fri, 7 Mar 2025 17:38:21 +0800 Subject: [PATCH 24/59] fix dockerfile Signed-off-by: stoneshi-yunify --- base/Dockerfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/base/Dockerfile b/base/Dockerfile index 109861a..e98c46b 100644 --- a/base/Dockerfile +++ b/base/Dockerfile @@ -139,8 +139,7 @@ RUN echo node > .nvmrc # Download and install Node.js RUN nvm install 22 -RUN npm -g config set user root -RUN npm i -g watch-cli vsce typescript +RUN npm install --global watch-cli vsce typescript # Install Yarn RUN npm install --global yarn From a06b0ee15cbdff6491db3c3c7f6715feca0c82ce Mon Sep 17 00:00:00 2001 From: stoneshi-yunify Date: Fri, 7 Mar 2025 18:15:08 +0800 Subject: [PATCH 25/59] fix dockerfile Signed-off-by: stoneshi-yunify --- base/Dockerfile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/base/Dockerfile b/base/Dockerfile index e98c46b..d7d242a 100644 --- a/base/Dockerfile +++ b/base/Dockerfile @@ -1,5 +1,6 @@ FROM ubuntu:24.04 +# Set working directory WORKDIR /root # Set PATH @@ -103,9 +104,9 @@ RUN add-apt-repository ppa:longsleep/golang-backports && \ apt-get install -y golang-go # Settings for golang -ENV GOROOT=/usr/local/go -ENV GOPATH=/home/jenkins/go -ENV PATH=$PATH:/usr/local/go/bin:$GOPATH/bin +ENV GOROOT=$(go env GOROOT) +ENV GOPATH=$(go env GOPATH) +ENV PATH=$PATH:$GOROOT/bin:$GOPATH/bin RUN mkdir -p $GOPATH/bin && mkdir -p $GOPATH/src && mkdir -p $GOPATH/pkg # Install sdkman From 2943805c0e3b8d6e9f9ff2c9aa8dd0e307b681c7 Mon Sep 17 00:00:00 2001 From: stoneshi-yunify Date: Fri, 7 Mar 2025 18:16:20 +0800 Subject: [PATCH 26/59] fix dockerfile Signed-off-by: stoneshi-yunify --- base/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base/Dockerfile b/base/Dockerfile index d7d242a..e30e99a 100644 --- a/base/Dockerfile +++ b/base/Dockerfile @@ -162,7 +162,7 @@ RUN docker --version && \ podman --version && \ java --version && \ helm version && \ - kubectl version --client --short && \ + kubectl version --client && \ ks version && \ sonar-scanner --version && \ dotnet --version && \ From 8660de1d22bf1ef3bd5faa78026368421e7c399f Mon Sep 17 00:00:00 2001 From: stoneshi-yunify Date: Fri, 7 Mar 2025 18:21:01 +0800 Subject: [PATCH 27/59] fix dockerfile Signed-off-by: stoneshi-yunify --- base/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/base/Dockerfile b/base/Dockerfile index e30e99a..4082091 100644 --- a/base/Dockerfile +++ b/base/Dockerfile @@ -104,8 +104,8 @@ RUN add-apt-repository ppa:longsleep/golang-backports && \ apt-get install -y golang-go # Settings for golang -ENV GOROOT=$(go env GOROOT) -ENV GOPATH=$(go env GOPATH) +ENV GOROOT="$(go env GOROOT)" +ENV GOPATH="$(go env GOPATH)" ENV PATH=$PATH:$GOROOT/bin:$GOPATH/bin RUN mkdir -p $GOPATH/bin && mkdir -p $GOPATH/src && mkdir -p $GOPATH/pkg From 2eb1ed383e15511d8581047dd646aa36d0c96d79 Mon Sep 17 00:00:00 2001 From: stoneshi-yunify Date: Mon, 10 Mar 2025 16:55:53 +0800 Subject: [PATCH 28/59] fix dockerfile Signed-off-by: stoneshi-yunify --- base/Dockerfile | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/base/Dockerfile b/base/Dockerfile index 4082091..798249f 100644 --- a/base/Dockerfile +++ b/base/Dockerfile @@ -66,10 +66,7 @@ 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 -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 && \ - chmod 700 get_helm.sh && \ - ./get_helm.sh && \ - rm get_helm.sh +RUN curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash # Install kubectl RUN curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/$(dpkg --print-architecture)/kubectl" && \ From 9467af99a78b7dd0ee063ec42a2f8b49cd3d2402 Mon Sep 17 00:00:00 2001 From: stoneshi-yunify Date: Tue, 11 Mar 2025 11:38:53 +0800 Subject: [PATCH 29/59] fix dockerfile Signed-off-by: stoneshi-yunify --- base/Dockerfile | 56 ++++++++++++++++++++++++++----------------------- 1 file changed, 30 insertions(+), 26 deletions(-) diff --git a/base/Dockerfile b/base/Dockerfile index 798249f..04877da 100644 --- a/base/Dockerfile +++ b/base/Dockerfile @@ -1,10 +1,11 @@ FROM ubuntu:24.04 +ARG TARGETARCH + # Set working directory WORKDIR /root -# Set PATH -ENV PATH=$PATH:/usr/local:/usr/local/bin +ENV JENKINS_HOME /home/jenkins # Set Bash as the default shell RUN chsh -s /bin/bash @@ -48,8 +49,9 @@ RUN apt-get update && \ openjdk-21-jdk ## Settings for Java -ENV JDK_HOME="$(dirname $(dirname $(readlink -f $(which java))))" +ENV JDK_HOME=/usr/lib/jvm/java-21-openjdk-${TARGETARCH} ENV JAVA_HOME=$JDK_HOME +ENV PATH=$PATH:${JAVA_HOME}/bin # Settings for python RUN ln -fs $(which python3) /usr/bin/python && ln -fs $(which pip3) /usr/bin/pip @@ -100,9 +102,11 @@ RUN add-apt-repository ppa:longsleep/golang-backports && \ apt-get update && \ apt-get install -y golang-go +RUN go env -w GOPATH=$JENKINS_HOME/go + # Settings for golang -ENV GOROOT="$(go env GOROOT)" -ENV GOPATH="$(go env GOPATH)" +ENV GOROOT=/usr/local/go +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 @@ -120,7 +124,7 @@ RUN curl -f -L https://archive.apache.org/dist/maven/maven-3/${MAVEN_VERSION}/bi ENV M2_HOME=/opt/apache-maven-$MAVEN_VERSION ENV maven.home=$M2_HOME ENV M2=$M2_HOME/bin -ENV PATH=$PATH:$M2:${JAVA_HOME}/bin +ENV PATH=$PATH:$M2 # Install ant ENV ANT_VERSION=1.10.15 @@ -155,26 +159,26 @@ COPY *.conf /etc/containers/ VOLUME /var/lib/containers # Verify installations -RUN docker --version && \ - podman --version && \ - java --version && \ - helm version && \ - kubectl version --client && \ - ks version && \ - sonar-scanner --version && \ - dotnet --version && \ - go version && \ - gradle --version && \ - mvn --version && \ - ant --version && \ - nvm --version && \ - nvm current && \ - npm --version && \ - node --version && \ - yarn --version && \ - python --version && \ - pip --version && \ - kustomize version +RUN echo "docker: $(docker --version) && \ + podman: $(podman --version) && \ + java: $(java --version) && \ + helm: $(helm version) && \ + kubectl: $(kubectl version --client) && \ + ks: $(ks version) && \ + sonar-scanner: $(sonar-scanner --version) && \ + dotnet: $(dotnet --version) && \ + go: $(go version) && \ + gradle: $(gradle --version) && \ + mvn: $(mvn --version) && \ + ant: $(ant --version) && \ + nvm: $(nvm --version) && \ + nvm current: $(nvm current) && \ + npm: $(npm --version) && \ + node: $(node --version) && \ + yarn: $(yarn --version) && \ + python: $(python --version) && \ + pip: $(pip --version) && \ + kustomize: $(kustomize version)" # Clean up RUN apt-get clean && \ From 3e82c91515bfd3c85ce2acfb8a4dbc58f88ba5e7 Mon Sep 17 00:00:00 2001 From: stoneshi-yunify Date: Tue, 11 Mar 2025 12:49:24 +0800 Subject: [PATCH 30/59] fix dockerfile Signed-off-by: stoneshi-yunify --- base/Dockerfile | 56 ++++++++++++++++++++++++++----------------------- 1 file changed, 30 insertions(+), 26 deletions(-) diff --git a/base/Dockerfile b/base/Dockerfile index 04877da..8a44d73 100644 --- a/base/Dockerfile +++ b/base/Dockerfile @@ -76,7 +76,7 @@ RUN curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/s rm kubectl # Install kustomize -RUN curl -s "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" | bash +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 @@ -91,21 +91,22 @@ RUN arch=$(dpkg --print-architecture) && \ 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 && \ - ln -s /opt/sonar-scanner-${SONAR_SCANNER_VERSION}-${TARGET_ARCH}/bin/sonar-scanner /usr/local/bin/sonar-scanner + ln -fs /opt/sonar-scanner-${SONAR_SCANNER_VERSION}-${TARGET_ARCH}/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 -RUN add-apt-repository ppa:longsleep/golang-backports && \ +ENV GOVERSION=1.23 +RUN add-apt-repository -y ppa:longsleep/golang-backports && \ apt-get update && \ - apt-get install -y golang-go + apt-get install -y golang-${GOVERSION}-go RUN go env -w GOPATH=$JENKINS_HOME/go # Settings for golang -ENV GOROOT=/usr/local/go +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 @@ -118,6 +119,8 @@ ENV GRADLE_VERSION=8.13 RUN 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 @@ -147,7 +150,7 @@ RUN npm install --global watch-cli vsce typescript RUN npm install --global yarn # Install .NET -RUN add-apt-repository ppa:dotnet/backports && \ +RUN add-apt-repository -y ppa:dotnet/backports && \ apt-get update && \ apt-get install -y dotnet-sdk-9.0 @@ -159,26 +162,27 @@ COPY *.conf /etc/containers/ VOLUME /var/lib/containers # Verify installations -RUN echo "docker: $(docker --version) && \ - podman: $(podman --version) && \ - java: $(java --version) && \ - helm: $(helm version) && \ - kubectl: $(kubectl version --client) && \ - ks: $(ks version) && \ - sonar-scanner: $(sonar-scanner --version) && \ - dotnet: $(dotnet --version) && \ - go: $(go version) && \ - gradle: $(gradle --version) && \ - mvn: $(mvn --version) && \ - ant: $(ant --version) && \ - nvm: $(nvm --version) && \ - nvm current: $(nvm current) && \ - npm: $(npm --version) && \ - node: $(node --version) && \ - yarn: $(yarn --version) && \ - python: $(python --version) && \ - pip: $(pip --version) && \ - kustomize: $(kustomize version)" +RUN printenv +RUN echo "docker: $(docker --version)" +RUN echo "podman: $(podman --version)" +RUN echo "java: $(java --version)" +RUN echo "helm: $(helm version)" +RUN echo "kubectl: $(kubectl version --client)" +RUN echo "ks: $(ks version)" +RUN echo "sonar-scanner: $(sonar-scanner --version)" +RUN echo "dotnet: $(dotnet --version)" +RUN echo "go: $(go version)" +RUN echo "gradle: $(gradle --version)" +RUN echo "mvn: $(mvn --version)" +RUN echo "ant: $(ant --version)" +RUN echo "nvm: $(nvm --version)" +RUN echo "nvm current: $(nvm current)" +RUN echo "npm: $(npm --version)" +RUN echo "node: $(node --version)" +RUN echo "yarn: $(yarn --version)" +RUN echo "python: $(python --version)" +RUN echo "pip: $(pip --version)" +RUN echo "kustomize: $(kustomize version)" # Clean up RUN apt-get clean && \ From fc297f5684b735d8eff362041bf0aab32e2bfd84 Mon Sep 17 00:00:00 2001 From: stoneshi-yunify Date: Tue, 11 Mar 2025 12:58:07 +0800 Subject: [PATCH 31/59] fix dockerfile Signed-off-by: stoneshi-yunify --- base/Dockerfile | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/base/Dockerfile b/base/Dockerfile index 8a44d73..8e39227 100644 --- a/base/Dockerfile +++ b/base/Dockerfile @@ -99,18 +99,16 @@ RUN curl -fL https://github.com/kubesphere-sigs/ks/releases/download/v0.0.73/ks- # Install golang ENV GOVERSION=1.23 +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 -# Settings for golang -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 - # Install sdkman RUN curl -s "https://get.sdkman.io" | bash From 58299c44e368320c3d6f90d501af159e6d0fee35 Mon Sep 17 00:00:00 2001 From: stoneshi-yunify Date: Tue, 11 Mar 2025 13:14:59 +0800 Subject: [PATCH 32/59] fix dockerfile Signed-off-by: stoneshi-yunify --- base/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base/Dockerfile b/base/Dockerfile index 8e39227..e322443 100644 --- a/base/Dockerfile +++ b/base/Dockerfile @@ -172,7 +172,7 @@ RUN echo "dotnet: $(dotnet --version)" RUN echo "go: $(go version)" RUN echo "gradle: $(gradle --version)" RUN echo "mvn: $(mvn --version)" -RUN echo "ant: $(ant --version)" +RUN echo "ant: $(ant -version)" RUN echo "nvm: $(nvm --version)" RUN echo "nvm current: $(nvm current)" RUN echo "npm: $(npm --version)" From 5bbafd3b052ffa7308076ec09049ac74d4dee0d7 Mon Sep 17 00:00:00 2001 From: stoneshi-yunify Date: Tue, 11 Mar 2025 14:17:32 +0800 Subject: [PATCH 33/59] fix dockerfile Signed-off-by: stoneshi-yunify --- Makefile | 29 ++--------------------------- OWNERS | 19 +------------------ README.md | 17 +++++++++++------ base/Dockerfile | 1 + base/README.md | 20 +++++++++++++++++++- 5 files changed, 34 insertions(+), 52 deletions(-) diff --git a/Makefile b/Makefile index b783e45..1f9e9d0 100644 --- a/Makefile +++ b/Makefile @@ -1,30 +1,5 @@ COMMIT := $(shell git rev-parse --short HEAD) VERSION := dev-$(shell git describe --tags $(shell git rev-list --tags --max-count=1)) -build-base-podman: - docker build base -f base/podman/Dockerfile -t kubespheredev/builder-base:$(VERSION)-podman -push-base-podman: - docker push kubespheredev/builder-base:$(VERSION)-podman - -build-maven-podman: - docker build maven -f maven/podman/Dockerfile -t kubespheredev/builder-maven:$(VERSION)-podman -push-maven-podman: - docker push kubespheredev/builder-maven:$(VERSION)-podman - -build-maven-jdk11: - docker build maven -f maven/Dockerfile -t kubespheredev/builder-maven:$(VERSION)-jdk11 \ ---build-arg JDK_VERSION=11 -push-maven-jdk11: - docker push kubespheredev/builder-maven:$(VERSION)-jdk11 - -build-maven-jdk17: - docker build maven -f maven/Dockerfile -t kubespheredev/builder-maven:$(VERSION)-jdk17 \ ---build-arg JDK_VERSION=17 --build-arg JDK_HOME=/usr/java/default -push-maven-jdk17: - docker push kubespheredev/builder-maven:$(VERSION)-jdk17 - -build-maven-jdk17-podman: - docker build maven -f maven/podman/Dockerfile -t kubespheredev/builder-maven:$(VERSION)-jdk17-podman \ ---build-arg JDK_VERSION=17 --build-arg JDK_HOME=/usr/java/default -push-maven-jdk17-podman: - docker push kubespheredev/builder-maven:$(VERSION)-jdk17-podman +build-base: + docker buildx build base -f base/Dockerfile -t kubesphere/builder-base:$(VERSION) diff --git a/OWNERS b/OWNERS index e6de9b3..ebbe45c 100644 --- a/OWNERS +++ b/OWNERS @@ -1,29 +1,12 @@ approvers: - - zryfish - - rayzhou2017 - - shaowenchen - - linuxsuren + - stoneshi-yunify - chilianyi - - yudong2015 reviewers: - rayzhou2017 - - zryfish - - shaowenchen - benjaminhuo - calvinyv - - FeynmanZhou - - huanggze - - huojiao2006 - - Ma-Dan - - magicsong - pixiake - - runzexia - wansir - - wnxn - zheng1 - - soulseen - - linuxsuren - - JohnNiang - chilianyi - - yudong2015 diff --git a/README.md b/README.md index d2f5ec9..c7e3a70 100644 --- a/README.md +++ b/README.md @@ -19,12 +19,19 @@ This repo stores the build files of image for these podTemplate. Welcome to contribute. ## Images +Images for both production and development: + +| Name | Introduction | Docker Pulls | +|---------------------------|--------------------------|---------------------------------------------------------------------------------------------------------------------------------------| +| `kubesphere/builder-base` | [README](base/README.md) | [![Docker Pulls](https://img.shields.io/docker/pulls/kubesphere/builder-go.svg)](https://hub.docker.com/r/kubesphere/builder-go/tags) | + +## Legacy Images +Legacy images built on centos:7 are no longer developed but may be still working. For production: | Name | Docker Pulls | |---|---| -| `kubesphere/builder-base` | [![Docker Pulls](https://img.shields.io/docker/pulls/kubesphere/builder-base.svg)](https://hub.docker.com/r/kubesphere/builder-base/tags) | | `kubesphere/builder-go` | [![Docker Pulls](https://img.shields.io/docker/pulls/kubesphere/builder-go.svg)](https://hub.docker.com/r/kubesphere/builder-go/tags) | | `kubesphere/builder-maven` | [![Docker Pulls](https://img.shields.io/docker/pulls/kubesphere/builder-maven.svg)](https://hub.docker.com/r/kubesphere/builder-maven/tags) | | `kubesphere/builder-gradle` | [![Docker Pulls](https://img.shields.io/docker/pulls/kubesphere/builder-gradle.svg)](https://hub.docker.com/r/kubesphere/builder-gradle/tags) | @@ -36,7 +43,6 @@ For development: | Name | Docker Pulls | |---|---| -| `kubespheredev/builder-base` | [![Docker Pulls](https://img.shields.io/docker/pulls/kubespheredev/builder-base.svg)](https://hub.docker.com/r/kubespheredev/builder-base/tags) | | `kubespheredev/builder-go` | [![Docker Pulls](https://img.shields.io/docker/pulls/kubespheredev/builder-go.svg)](https://hub.docker.com/r/kubespheredev/builder-go/tags) | | `kubespheredev/builder-maven` | [![Docker Pulls](https://img.shields.io/docker/pulls/kubespheredev/builder-maven.svg)](https://hub.docker.com/r/kubespheredev/builder-maven/tags) | | `kubespheredev/builder-gradle` | [![Docker Pulls](https://img.shields.io/docker/pulls/kubespheredev/builder-gradle.svg)](https://hub.docker.com/r/kubespheredev/builder-gradle/tags) | @@ -45,15 +51,14 @@ For development: | `kubespheredev/builder-python` | [![Docker Pulls](https://img.shields.io/docker/pulls/kubespheredev/builder-python.svg)](https://hub.docker.com/r/kubespheredev/builder-python/tags) | ## How to Build +Check out the Makefile. -Enter the directory and execute: +For example, build the base image: ```bash -docker build -f Dockerfile . +make build-base ``` -It's a better way to provide jenkinsfile for compiling images, like base agent. - ## Join & Contact Community - Slack [#sig-devops](https://kubesphere.slack.com/messages/sig-devops) diff --git a/base/Dockerfile b/base/Dockerfile index e322443..c517a50 100644 --- a/base/Dockerfile +++ b/base/Dockerfile @@ -20,6 +20,7 @@ RUN echo '. "${BASH_ENV}"' >> /root/.bashrc RUN apt-get update && \ apt-get install -y \ ca-certificates \ + git \ curl \ perl \ openssl \ diff --git a/base/README.md b/base/README.md index 8bb4e5b..0c43906 100644 --- a/base/README.md +++ b/base/README.md @@ -1,2 +1,20 @@ -Base image with common sdks and utilities +Base image with latest common sdks and utilities built with ubuntu, include: +- docker cli +- podman +- kubectl +- kustomize +- helm +- jdk +- gradle +- sonar-scanner +- python +- maven +- ant +- dotnet +- go +- nodejs +- yarn +- npm +- ks +- ... From 5760a8f5ac35500fd2bff853f55a2f24fd3e9667 Mon Sep 17 00:00:00 2001 From: stoneshi-yunify Date: Tue, 11 Mar 2025 15:04:53 +0800 Subject: [PATCH 34/59] fix dockerfile Signed-off-by: stoneshi-yunify --- OWNERS | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/OWNERS b/OWNERS index ebbe45c..e7684e0 100644 --- a/OWNERS +++ b/OWNERS @@ -1,5 +1,6 @@ approvers: - stoneshi-yunify + - renyunkang - chilianyi reviewers: @@ -9,4 +10,8 @@ reviewers: - pixiake - wansir - zheng1 + - stoneshi-yunify + - renyunkang - chilianyi + + From 9a34cb33bcef4aa4466a07121d31e9ee6732ae9b Mon Sep 17 00:00:00 2001 From: stoneshi-yunify Date: Tue, 11 Mar 2025 15:35:42 +0800 Subject: [PATCH 35/59] fix dockerfile Signed-off-by: stoneshi-yunify --- base/Dockerfile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/base/Dockerfile b/base/Dockerfile index c517a50..03d2c99 100644 --- a/base/Dockerfile +++ b/base/Dockerfile @@ -69,7 +69,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://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash +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 # Install kubectl RUN curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/$(dpkg --print-architecture)/kubectl" && \ From 6341ca44db1a05bf602efe3f6155ae37f7a5a225 Mon Sep 17 00:00:00 2001 From: stoneshi-yunify Date: Tue, 11 Mar 2025 15:48:38 +0800 Subject: [PATCH 36/59] fix dockerfile Signed-off-by: stoneshi-yunify --- base/Dockerfile | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/base/Dockerfile b/base/Dockerfile index 03d2c99..ee2df3b 100644 --- a/base/Dockerfile +++ b/base/Dockerfile @@ -47,6 +47,7 @@ RUN apt-get update && \ python3-pip \ podman \ software-properties-common \ + apt-transport-https \ openjdk-21-jdk ## Settings for Java @@ -76,9 +77,12 @@ RUN curl https://baltocdn.com/helm/signing.asc | gpg --dearmor | tee /usr/share/ apt-get install -y helm # Install kubectl -RUN curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/$(dpkg --print-architecture)/kubectl" && \ - install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl && \ - rm 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 && \ + chmod 644 /etc/apt/keyrings/kubernetes-apt-keyring.gpg && \ + echo 'deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/v1.32/deb/ /' | tee /etc/apt/sources.list.d/kubernetes.list && \ + chmod 644 /etc/apt/sources.list.d/kubernetes.list && \ + apt-get update && \ + apt-get install -y kubectl # Install kustomize RUN cd /usr/local/bin && curl -s "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" | bash From 1ba38de303e5f31157baf1307ebb64cf7ae9bdd6 Mon Sep 17 00:00:00 2001 From: stoneshi-yunify Date: Tue, 11 Mar 2025 16:00:51 +0800 Subject: [PATCH 37/59] fix dockerfile Signed-off-by: stoneshi-yunify --- base/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base/Dockerfile b/base/Dockerfile index ee2df3b..bacd73f 100644 --- a/base/Dockerfile +++ b/base/Dockerfile @@ -18,7 +18,7 @@ RUN echo '. "${BASH_ENV}"' >> /root/.bashrc # Install utils RUN apt-get update && \ - apt-get install -y \ + apt-get install -y --no-install-recommends \ ca-certificates \ git \ curl \ From e85a4de2439430bc9ccc1f4576b31e81ebd9e2e1 Mon Sep 17 00:00:00 2001 From: yonghongshi Date: Tue, 8 Apr 2025 18:15:28 +0800 Subject: [PATCH 38/59] Update Dockerfile --- base/Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/base/Dockerfile b/base/Dockerfile index bacd73f..a45a0ef 100644 --- a/base/Dockerfile +++ b/base/Dockerfile @@ -48,6 +48,7 @@ RUN apt-get update && \ podman \ software-properties-common \ apt-transport-https \ + fuse-overlayfs \ openjdk-21-jdk ## Settings for Java From 7149d26b6891902f511e03a60f0c5d220b87d7d4 Mon Sep 17 00:00:00 2001 From: yonghongshi Date: Wed, 16 Apr 2025 10:44:58 +0800 Subject: [PATCH 39/59] Update Dockerfile --- base/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base/Dockerfile b/base/Dockerfile index a45a0ef..158eced 100644 --- a/base/Dockerfile +++ b/base/Dockerfile @@ -200,4 +200,4 @@ RUN apt-get clean && \ WORKDIR /home/jenkins # Default command -CMD ["docker", "version"] +CMD ["/bin/bash"] From 552414ffdf33ee965f3fc22aff2a1081e5d3aecf Mon Sep 17 00:00:00 2001 From: stoneshi-yunify Date: Fri, 18 Apr 2025 13:40:37 +0800 Subject: [PATCH 40/59] fix dockerfile Signed-off-by: stoneshi-yunify --- base/Dockerfile | 7 +- base/README.md | 3 + base/containers.conf | 3 - base/registries.conf | 2 - base/storage.conf | 192 ------------------------------------------- 5 files changed, 4 insertions(+), 203 deletions(-) delete mode 100644 base/containers.conf delete mode 100644 base/registries.conf delete mode 100644 base/storage.conf diff --git a/base/Dockerfile b/base/Dockerfile index 158eced..7a4cb7d 100644 --- a/base/Dockerfile +++ b/base/Dockerfile @@ -164,11 +164,6 @@ RUN add-apt-repository -y ppa:dotnet/backports && \ ENV PATH=$PATH:/root/.nuget/tools:/root/.dotnet/tools -# Settings for podman -RUN mkdir -p /etc/containers -COPY *.conf /etc/containers/ -VOLUME /var/lib/containers - # Verify installations RUN printenv RUN echo "docker: $(docker --version)" @@ -194,7 +189,7 @@ RUN echo "kustomize: $(kustomize version)" # Clean up RUN apt-get clean && \ - rm -rf /var/lib/apt/lists/* + rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* # Set working directory WORKDIR /home/jenkins diff --git a/base/README.md b/base/README.md index 0c43906..5001a60 100644 --- a/base/README.md +++ b/base/README.md @@ -18,3 +18,6 @@ Base image with latest common sdks and utilities built with ubuntu, include: - ks - ... +**NOTE** +1. Because the image has both docker and podman installed, `docker` command is no longer a alias of `podman`, you should use `podman` command explicitly. + diff --git a/base/containers.conf b/base/containers.conf deleted file mode 100644 index e638b65..0000000 --- a/base/containers.conf +++ /dev/null @@ -1,3 +0,0 @@ -[engine] -cgroup_manager="cgroupfs" -events_logger="file" diff --git a/base/registries.conf b/base/registries.conf deleted file mode 100644 index 828db1a..0000000 --- a/base/registries.conf +++ /dev/null @@ -1,2 +0,0 @@ -[registries.search] -registries = ["docker.io"] diff --git a/base/storage.conf b/base/storage.conf deleted file mode 100644 index b9e22af..0000000 --- a/base/storage.conf +++ /dev/null @@ -1,192 +0,0 @@ -# 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 261fd446c68f15008db4967db5adc721b6ce8126 Mon Sep 17 00:00:00 2001 From: stoneshi-yunify Date: Tue, 22 Apr 2025 10:19:28 +0800 Subject: [PATCH 41/59] remove dotnet Signed-off-by: stoneshi-yunify --- base/Dockerfile | 8 -------- base/README.md | 1 - 2 files changed, 9 deletions(-) diff --git a/base/Dockerfile b/base/Dockerfile index 7a4cb7d..f9c8462 100644 --- a/base/Dockerfile +++ b/base/Dockerfile @@ -157,13 +157,6 @@ RUN npm install --global watch-cli vsce typescript # Install Yarn RUN npm install --global yarn -# Install .NET -RUN add-apt-repository -y ppa:dotnet/backports && \ - apt-get update && \ - apt-get install -y dotnet-sdk-9.0 - -ENV PATH=$PATH:/root/.nuget/tools:/root/.dotnet/tools - # Verify installations RUN printenv RUN echo "docker: $(docker --version)" @@ -173,7 +166,6 @@ RUN echo "helm: $(helm version)" RUN echo "kubectl: $(kubectl version --client)" RUN echo "ks: $(ks version)" RUN echo "sonar-scanner: $(sonar-scanner --version)" -RUN echo "dotnet: $(dotnet --version)" RUN echo "go: $(go version)" RUN echo "gradle: $(gradle --version)" RUN echo "mvn: $(mvn --version)" diff --git a/base/README.md b/base/README.md index 5001a60..e2f2084 100644 --- a/base/README.md +++ b/base/README.md @@ -10,7 +10,6 @@ Base image with latest common sdks and utilities built with ubuntu, include: - python - maven - ant -- dotnet - go - nodejs - yarn From 3b902fecb985103896d58bc80ba6cf15b25d21a1 Mon Sep 17 00:00:00 2001 From: stoneshi-yunify Date: Fri, 9 May 2025 17:01:14 +0800 Subject: [PATCH 42/59] update dockerfile Signed-off-by: stoneshi-yunify --- base/Dockerfile | 54 +++++++++---------------------------------------- 1 file changed, 10 insertions(+), 44 deletions(-) diff --git a/base/Dockerfile b/base/Dockerfile index f9c8462..3e7d089 100644 --- a/base/Dockerfile +++ b/base/Dockerfile @@ -7,15 +7,6 @@ WORKDIR /root ENV JENKINS_HOME /home/jenkins -# Set Bash as the default shell -RUN chsh -s /bin/bash -SHELL ["/bin/bash", "-c"] - -# Create a script file sourced by both interactive and non-interactive bash shells -ENV BASH_ENV=/root/.bash_env -RUN touch "${BASH_ENV}" -RUN echo '. "${BASH_ENV}"' >> /root/.bashrc - # Install utils RUN apt-get update && \ apt-get install -y --no-install-recommends \ @@ -124,8 +115,7 @@ RUN curl -s "https://get.sdkman.io" | bash # Install gradle ENV GRADLE_VERSION=8.13 -RUN source "/root/.sdkman/bin/sdkman-init.sh" && \ - sdk install gradle ${GRADLE_VERSION} +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 @@ -146,38 +136,14 @@ RUN wget -q https://archive.apache.org/dist/ant/binaries/apache-ant-${ANT_VERSIO ENV ANT_HOME=/opt/ant ENV PATH=${PATH}:${ANT_HOME}/bin -# Install nvm -RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | PROFILE="${BASH_ENV}" bash -RUN echo node > .nvmrc - -# Download and install Node.js -RUN nvm install 22 -RUN npm install --global watch-cli vsce typescript - -# Install Yarn -RUN npm install --global yarn - -# Verify installations -RUN printenv -RUN echo "docker: $(docker --version)" -RUN echo "podman: $(podman --version)" -RUN echo "java: $(java --version)" -RUN echo "helm: $(helm version)" -RUN echo "kubectl: $(kubectl version --client)" -RUN echo "ks: $(ks version)" -RUN echo "sonar-scanner: $(sonar-scanner --version)" -RUN echo "go: $(go version)" -RUN echo "gradle: $(gradle --version)" -RUN echo "mvn: $(mvn --version)" -RUN echo "ant: $(ant -version)" -RUN echo "nvm: $(nvm --version)" -RUN echo "nvm current: $(nvm current)" -RUN echo "npm: $(npm --version)" -RUN echo "node: $(node --version)" -RUN echo "yarn: $(yarn --version)" -RUN echo "python: $(python --version)" -RUN echo "pip: $(pip --version)" -RUN echo "kustomize: $(kustomize version)" +# Set up NodeSource repository for Node.js +RUN curl -fsSL https://deb.nodesource.com/setup_22.x | bash - + +# Install Node.js +RUN apt-get install -y nodejs + +# Install Yarn and other packages +RUN npm install --global --force yarn watch-cli typescript # Clean up RUN apt-get clean && \ @@ -187,4 +153,4 @@ RUN apt-get clean && \ WORKDIR /home/jenkins # Default command -CMD ["/bin/bash"] +ENTRYPOINT ["/bin/bash"] \ No newline at end of file From 08b29ddba7e64e3e4e5bc0f305f3aca1cfc29fd9 Mon Sep 17 00:00:00 2001 From: stoneshi-yunify Date: Fri, 9 May 2025 17:03:06 +0800 Subject: [PATCH 43/59] fix action and readme Signed-off-by: stoneshi-yunify --- .github/actions/build/action.yml | 1 + README.md | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/actions/build/action.yml b/.github/actions/build/action.yml index 9998604..ec6ad58 100644 --- a/.github/actions/build/action.yml +++ b/.github/actions/build/action.yml @@ -55,6 +55,7 @@ runs: type=ref,event=branch,suffix=${{ inputs.tag-suffix }} type=ref,event=pr,suffix=${{ inputs.tag-suffix }} type=semver,pattern={{version}},prefix=v,suffix=${{ inputs.tag-suffix }} + type=raw,value=latest - name: Set up QEMU uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx diff --git a/README.md b/README.md index c7e3a70..f0ec07e 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ The definition method of podTemplate is: ```bash podTemplate(containers: [ - containerTemplate(name: 'base', image: 'kubesphere/builder-base:v2.1.0', ttyEnabled: true, command: 'cat') + containerTemplate(name: 'base', image: 'kubesphere/builder-base:latest', ttyEnabled: true, command: 'cat') ]) ``` From 6faa261c52b48ab05af681ce1deea2e806c407a5 Mon Sep 17 00:00:00 2001 From: stoneshi-yunify Date: Mon, 12 May 2025 11:02:52 +0800 Subject: [PATCH 44/59] fix dockerfile Signed-off-by: stoneshi-yunify --- base/Dockerfile | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/base/Dockerfile b/base/Dockerfile index 3e7d089..da2aa6f 100644 --- a/base/Dockerfile +++ b/base/Dockerfile @@ -92,7 +92,8 @@ RUN arch=$(dpkg --print-architecture) && \ 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 && \ - ln -fs /opt/sonar-scanner-${SONAR_SCANNER_VERSION}-${TARGET_ARCH}/bin/sonar-scanner /usr/local/bin/sonar-scanner + 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 && \ @@ -121,8 +122,9 @@ RUN ln -fs /root/.sdkman/candidates/gradle/current/bin/gradle /usr/local/bin/gra # 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 -ENV M2_HOME=/opt/apache-maven-$MAVEN_VERSION +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 From e583fc15e498cde90db2c157c4fd6092520ce324 Mon Sep 17 00:00:00 2001 From: stoneshi-yunify Date: Mon, 12 May 2025 16:47:36 +0800 Subject: [PATCH 45/59] update softwares Signed-off-by: stoneshi-yunify --- base/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/base/Dockerfile b/base/Dockerfile index da2aa6f..8286f78 100644 --- a/base/Dockerfile +++ b/base/Dockerfile @@ -100,7 +100,7 @@ RUN curl -fL https://github.com/kubesphere-sigs/ks/releases/download/v0.0.73/ks- mv ks /usr/local/bin/ # Install golang -ENV GOVERSION=1.23 +ENV GOVERSION=1.24 ENV GOROOT=/usr/lib/go-${GOVERSION} ENV GOPATH=$JENKINS_HOME/go ENV PATH=$PATH:$GOROOT/bin:$GOPATH/bin @@ -115,7 +115,7 @@ RUN go env -w GOPATH=$JENKINS_HOME/go RUN curl -s "https://get.sdkman.io" | bash # Install gradle -ENV GRADLE_VERSION=8.13 +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 From b24879d6e13207cff69ee7b95402136f3c7e032b Mon Sep 17 00:00:00 2001 From: stoneshi-yunify Date: Thu, 29 May 2025 15:55:37 +0800 Subject: [PATCH 46/59] add docker link to podman Signed-off-by: stoneshi-yunify --- .github/actions/build/action.yml | 5 +---- .github/workflows/build.yaml | 13 ++++++++++++- README.md | 9 ++++++--- base/README.md | 3 --- base/podman/Dockerfile | 2 ++ 5 files changed, 21 insertions(+), 11 deletions(-) create mode 100644 base/podman/Dockerfile diff --git a/.github/actions/build/action.yml b/.github/actions/build/action.yml index ec6ad58..155e8fc 100644 --- a/.github/actions/build/action.yml +++ b/.github/actions/build/action.yml @@ -46,7 +46,6 @@ runs: - uses: actions/checkout@v4 - name: Docker meta for KubeSphere id: meta - if: github.repository_owner == 'kubesphere' uses: docker/metadata-action@v5 with: images: | @@ -55,13 +54,12 @@ runs: type=ref,event=branch,suffix=${{ inputs.tag-suffix }} type=ref,event=pr,suffix=${{ inputs.tag-suffix }} type=semver,pattern={{version}},prefix=v,suffix=${{ inputs.tag-suffix }} - type=raw,value=latest + type=raw,value=latest,suffix=${{ inputs.tag-suffix }} - name: Set up QEMU uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - name: Login to DockerHub - if: github.event_name != 'pull_request' && github.repository_owner == 'kubesphere' uses: docker/login-action@v3 with: registry: ${{ inputs.docker-registry }} @@ -69,7 +67,6 @@ runs: password: ${{ inputs.docker-password }} - name: Build and push Docker images uses: docker/build-push-action@v6 - if: github.repository_owner == 'kubesphere' with: context: ${{ inputs.context }} file: ${{ inputs.dockerfile }} diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 84c1841..4a48e10 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Build base agent + - name: Build base agent for docker uses: ./.github/actions/build with: context: base @@ -22,3 +22,14 @@ jobs: platforms: linux/amd64,linux/arm64 docker-namespace: ${{ secrets.DOCKER_HUB_USER }} docker-password: ${{ secrets.DOCKER_HUB_SECRETS }} + + - name: Build base agent for podman + uses: ./.github/actions/build + with: + context: base + dockerfile: base/podman/Dockerfile + image-name: builder-base + tag-suffix: -podman + platforms: linux/amd64,linux/arm64 + docker-namespace: ${{ secrets.DOCKER_HUB_USER }} + docker-password: ${{ secrets.DOCKER_HUB_SECRETS }} diff --git a/README.md b/README.md index f0ec07e..5a13224 100644 --- a/README.md +++ b/README.md @@ -21,9 +21,12 @@ Welcome to contribute. ## Images Images for both production and development: -| Name | Introduction | Docker Pulls | -|---------------------------|--------------------------|---------------------------------------------------------------------------------------------------------------------------------------| -| `kubesphere/builder-base` | [README](base/README.md) | [![Docker Pulls](https://img.shields.io/docker/pulls/kubesphere/builder-go.svg)](https://hub.docker.com/r/kubesphere/builder-go/tags) | +| Name | Introduction | Docker Pulls | +|---------------------------|--------------------------|-------------------------------------------------------------------------------------------------------------------------------------------| +| `kubesphere/builder-base` | [README](base/README.md) | [![Docker Pulls](https://img.shields.io/docker/pulls/kubesphere/builder-base.svg)](https://hub.docker.com/r/kubesphere/builder-base/tags) | + +**NOTE** +1. The image with tag `x.y.z-podman` has the very same utilities installed compared to the `x.y.z` image, the only difference is that the `x.y.z-podman` image makes a symbolic link of `docker` to `podman`, for easy use and backward compatibility. ## Legacy Images Legacy images built on centos:7 are no longer developed but may be still working. diff --git a/base/README.md b/base/README.md index e2f2084..c10bf66 100644 --- a/base/README.md +++ b/base/README.md @@ -17,6 +17,3 @@ Base image with latest common sdks and utilities built with ubuntu, include: - ks - ... -**NOTE** -1. Because the image has both docker and podman installed, `docker` command is no longer a alias of `podman`, you should use `podman` command explicitly. - diff --git a/base/podman/Dockerfile b/base/podman/Dockerfile new file mode 100644 index 0000000..0b2a279 --- /dev/null +++ b/base/podman/Dockerfile @@ -0,0 +1,2 @@ +FROM kubesphere/builder-base:latest +RUN ln -s -f /usr/bin/podman /usr/bin/docker From e5032a07c9a76015b6996b8c21e59808ccf8e6df Mon Sep 17 00:00:00 2001 From: stoneshi-yunify Date: Fri, 31 Oct 2025 18:16:14 +0800 Subject: [PATCH 47/59] 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 48/59] 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 49/59] 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 50/59] 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 51/59] 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 52/59] 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 53/59] 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 54/59] 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 55/59] 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 56/59] 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 57/59] 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 58/59] 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 From e1a7d037b5507545caf1042fad631eded0d87582 Mon Sep 17 00:00:00 2001 From: yonghongshi Date: Thu, 27 Nov 2025 17:46:57 +0800 Subject: [PATCH 59/59] Update Dockerfile --- base/Dockerfile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/base/Dockerfile b/base/Dockerfile index 2e7ca15..52b2491 100644 --- a/base/Dockerfile +++ b/base/Dockerfile @@ -164,6 +164,10 @@ RUN corepack prepare pnpm --activate ENV COREPACK_ENABLE_DOWNLOADS=0 ENV COREPACK_DEFAULT_TO_LATEST=0 +# Set default kubeconfig path +RUN mkdir -p /root/.kube +ENV KUBECONFIG=/root/.kube/config + # Clean up RUN apt-get clean && \ rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*