diff --git a/.github/actions/build/action.yml b/.github/actions/build/action.yml index 0e29506..155e8fc 100644 --- a/.github/actions/build/action.yml +++ b/.github/actions/build/action.yml @@ -43,57 +43,30 @@ 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 + uses: docker/metadata-action@v5 with: images: | - kubespheredev/${{ inputs.image-name }} - 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=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 }} - - name: Docker meta for Contributors - id: metaContributors - if: github.repository_owner != 'kubesphere' - uses: docker/metadata-action@v3 - 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 }} + type=raw,value=latest,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 - if: github.repository_owner == 'kubesphere' + uses: docker/build-push-action@v6 with: context: ${{ inputs.context }} file: ${{ inputs.dockerfile }} @@ -102,14 +75,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 02f0a2b..0000000 --- a/.github/workflows/build-podman.yaml +++ /dev/null @@ -1,151 +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 - 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 - 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 - docker-namespace: ${{ secrets.DOCKER_HUB_USER }} - docker-password: ${{ secrets.DOCKER_HUB_SECRETS }} - ghcr-token: ${{ secrets.GHCR_TOKEN }} - build-args: "GOLANG_VERSION=1.16.8" - - 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 - 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 - docker-namespace: ${{ secrets.DOCKER_HUB_USER }} - docker-password: ${{ secrets.DOCKER_HUB_SECRETS }} - ghcr-token: ${{ secrets.GHCR_TOKEN }} - build-args: "JDK_VERSION=11" - - 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 - 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 - 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 - 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 d5a6f7d..e6cdf5b 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -1,22 +1,20 @@ name: Build Images on: + workflow_dispatch: push: branches: - - master - - test-* # make it be easier for contributors to test + - master + - dev tags: - 'v*.*.*' - pull_request: - branches: - - 'master' jobs: BuildBase: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - name: Build base agent + - uses: actions/checkout@v4 + - name: Build base agent for docker uses: ./.github/actions/build with: context: base @@ -25,137 +23,14 @@ 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" - - 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" - - 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 }} + - 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/Makefile b/Makefile index f9ecafb..1f9e9d0 100644 --- a/Makefile +++ b/Makefile @@ -1,15 +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-jdk11: - docker build maven -f maven/Dockerfile -t kubespheredev/builder-maven:$(VERSION)-jdk11 --build-arg JDK_VERSION=11 +build-base: + docker buildx build base -f base/Dockerfile -t kubesphere/builder-base:$(VERSION) diff --git a/OWNERS b/OWNERS index 99614a6..e7684e0 100644 --- a/OWNERS +++ b/OWNERS @@ -1,25 +1,17 @@ approvers: - - zryfish - - rayzhou2017 - - shaowenchen - - linuxsuren + - stoneshi-yunify + - renyunkang + - chilianyi reviewers: - rayzhou2017 - - zryfish - - shaowenchen - benjaminhuo - calvinyv - - FeynmanZhou - - huanggze - - huojiao2006 - - Ma-Dan - - magicsong - pixiake - - runzexia - wansir - - wnxn - zheng1 - - soulseen - - linuxsuren - - JohnNiang + - stoneshi-yunify + - renyunkang + - chilianyi + + diff --git a/README.md b/README.md index d2f5ec9..5a13224 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') ]) ``` @@ -19,12 +19,22 @@ 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-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. 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 +46,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 +54,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 ecc5d48..52b2491 100644 --- a/base/Dockerfile +++ b/base/Dockerfile @@ -1,59 +1,179 @@ -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 +FROM ubuntu:24.04 + +ARG TARGETARCH + +# Set working directory +WORKDIR /root + +ENV JENKINS_HOME /home/jenkins + +# Install utils +RUN apt-get update && \ + apt-get install -y --no-install-recommends \ + ca-certificates \ + git \ + 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 \ + python3-pip \ + podman \ + software-properties-common \ + apt-transport-https \ + tini \ + 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 +VOLUME /var/lib/containers + +## Settings for 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 + +# 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 && \ + chmod a+r /etc/apt/keyrings/docker.asc && \ + echo \ + "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 docker-buildx-plugin docker-compose-plugin + +# Install 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 && \ + 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 + +# 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/ -ENV SONAR_SCANNER_VERSION 3.3.0.1492 +# 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 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 +RUN go env -w GOPATH=$JENKINS_HOME/go -ENV PATH $PATH:/usr/bin/sonar-scanner-$SONAR_SCANNER_VERSION-linux/bin +# Install sdkman +RUN curl -s "https://get.sdkman.io" | bash -COPY ./ ./ -RUN ./hack/install_utils.sh && rm -rf ./* +# 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 - + +# Install Node.js +RUN apt-get install -y nodejs + +# Install Yarn and other packages +RUN npm install --global --force corepack@latest npm yarn watch-cli typescript + +# Enable corepack +RUN corepack enable pnpm + +# Install pnpm +RUN corepack prepare pnpm --activate + +# Disable corepack update check +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/* + +# Set working directory +WORKDIR /home/jenkins -CMD ["docker","version"] +# Default command +ENTRYPOINT ["/usr/bin/tini", "--"] 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..c10bf66 100644 --- a/base/README.md +++ b/base/README.md @@ -1,14 +1,19 @@ -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 latest common sdks and utilities built with ubuntu, include: +- docker cli +- podman +- kubectl +- kustomize +- helm +- jdk +- gradle +- sonar-scanner +- python +- maven +- ant +- go +- nodejs +- yarn +- npm +- ks +- ... 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/hack/install_utils.sh b/base/hack/install_utils.sh deleted file mode 100755 index 0591535..0000000 --- a/base/hack/install_utils.sh +++ /dev/null @@ -1,67 +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://storage.googleapis.com/kubernetes-helm/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://storage.googleapis.com/kubernetes-helm/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 diff --git a/base/podman/Dockerfile b/base/podman/Dockerfile index affe2f1..0b2a279 100644 --- a/base/podman/Dockerfile +++ b/base/podman/Dockerfile @@ -1,70 +1,2 @@ -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 && \ - echo "alias docker=podman" >> /root/.bashrc && \ - 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 kubesphere/builder-base:latest +RUN ln -s -f /usr/bin/podman /usr/bin/docker diff --git a/base/registries.conf b/base/registries.conf index 828db1a..f3cc1c1 100644 --- a/base/registries.conf +++ b/base/registries.conf @@ -1,2 +1,23 @@ -[registries.search] -registries = ["docker.io"] + +# 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 b9e22af..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,7 +73,8 @@ 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 = "/usr/bin/fuse-overlayfs" +mount_program = "" # mountopt specifies comma separated list of extra mount options mountopt = "nodev" 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 76bb5d8..0000000 --- a/maven/Dockerfile +++ /dev/null @@ -1,33 +0,0 @@ -FROM kubespheredev/builder-base:v3.1.0 - -ARG JDK_VERSION 1.8.0 - -# java -ENV JAVA_VERSIOIN $JDK_VERSION -RUN yum install -y java-${JAVA_VERSIOIN}-openjdk-devel \ - java-${JAVA_VERSIOIN}-openjdk-devel.i686 - -# 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 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 $M2/set_java && rm $M2/set_java - -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 3af91dc..0000000 --- a/maven/podman/Dockerfile +++ /dev/null @@ -1,33 +0,0 @@ -FROM kubespheredev/builder-base:v3.1.0-podman - -ARG JDK_VERSION 1.8.0 - -# java -ENV JAVA_VERSIOIN $JDK_VERSION -RUN yum install -y java-${JAVA_VERSIOIN}-openjdk-devel \ - java-${JAVA_VERSIOIN}-openjdk-devel.i686 - -# 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 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 $M2/set_java && rm $M2/set_java - -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 dcb3ad0..0000000 --- a/nodejs/Dockerfile +++ /dev/null @@ -1,45 +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 \ - 94AE36675C464D64BAFA68DD7434390BDBE9B9C5 \ - FD3A5288F042B6850C66B31F09FE44734EB7990E \ - 71DCFD284A79C3B38668286BC97EC7A07EDE3FC1 \ - DD8F2338BAE7501E3DD5AC78C273792F7D83545D \ - C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8 \ - B9AE9905FFD7803F25714661B63B535A4C206CA9 \ - 77984A986EBC2AA786BC0F66B01FBB92821C587A \ - 8FCCA13FEF1D0C2E91008E09770F7A9A5AE15600 \ - 4ED778F539E3634C779C87C6D7062848A1AB005C \ - A48C2BEE680E841632CD4E44F07496B3EB3C1762 \ - B9E2F5981AA6E0CD28160D9FF13993A75599653C \ - ; 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 \ - && 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 \ - && 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 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 1eba566..0000000 --- a/nodejs/podman/Dockerfile +++ /dev/null @@ -1,45 +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 \ - 94AE36675C464D64BAFA68DD7434390BDBE9B9C5 \ - FD3A5288F042B6850C66B31F09FE44734EB7990E \ - 71DCFD284A79C3B38668286BC97EC7A07EDE3FC1 \ - DD8F2338BAE7501E3DD5AC78C273792F7D83545D \ - C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8 \ - B9AE9905FFD7803F25714661B63B535A4C206CA9 \ - 77984A986EBC2AA786BC0F66B01FBB92821C587A \ - 8FCCA13FEF1D0C2E91008E09770F7A9A5AE15600 \ - 4ED778F539E3634C779C87C6D7062848A1AB005C \ - A48C2BEE680E841632CD4E44F07496B3EB3C1762 \ - B9E2F5981AA6E0CD28160D9FF13993A75599653C \ - ; 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 \ - && 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 \ - && 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 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"]