Skip to content

Commit

Permalink
Merge pull request #77 from chilianyi/jdk17
Browse files Browse the repository at this point in the history
Add maven jdk17
  • Loading branch information
ks-ci-bot authored Nov 21, 2022
2 parents df3a038 + a8c618b commit 7758de7
Show file tree
Hide file tree
Showing 5 changed files with 98 additions and 14 deletions.
22 changes: 21 additions & 1 deletion .github/workflows/build-podman.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
21 changes: 20 additions & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
19 changes: 17 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
25 changes: 20 additions & 5 deletions maven/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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"]
25 changes: 20 additions & 5 deletions maven/podman/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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"]

0 comments on commit 7758de7

Please sign in to comment.