Skip to content

Commit 2d28937

Browse files
use centos10
Signed-off-by: stoneshi-yunify <[email protected]>
1 parent ebac872 commit 2d28937

File tree

7 files changed

+135
-264
lines changed

7 files changed

+135
-264
lines changed

.github/workflows/pull-request.yaml

Lines changed: 12 additions & 260 deletions
Original file line numberDiff line numberDiff line change
@@ -4,296 +4,48 @@ on:
44
push:
55
branches:
66
- master
7-
- test-* # make it be easier for contributors to test
7+
- dev
88
tags:
99
- 'v*.*.*'
1010
pull_request:
1111
branches:
1212
- 'master'
1313

1414
jobs:
15-
BuildCentOSJava11:
16-
runs-on: ubuntu-20.04
15+
BuildUbuntuJava11:
16+
runs-on: ubuntu-latest
1717
steps:
18-
- uses: actions/checkout@v2
18+
- uses: actions/checkout@v4
1919
- name: Docker meta for KubeSphere
2020
id: meta
21-
if: github.repository_owner == 'kubesphere'
22-
uses: docker/metadata-action@v3
21+
uses: docker/metadata-action@v5
2322
with:
2423
images: |
25-
kubespheredev/java-11-centos7
26-
ghcr.io/${{ github.repository_owner }}/java-11-centos7
24+
kubespheredev/java-11-centos10
2725
tags: |
28-
type=schedule
29-
type=ref,event=branch
30-
type=ref,event=pr
31-
type=semver,pattern=v{{version}}
32-
type=semver,pattern=v{{major}}.{{minor}}
33-
type=semver,pattern=v{{major}}
34-
type=sha
35-
- name: Docker meta for Contributors
36-
id: metaContributors
37-
if: github.repository_owner != 'kubesphere'
38-
uses: docker/metadata-action@v3
39-
with:
40-
images: |
41-
ghcr.io/${{ github.repository_owner }}/java-11-centos7
42-
tags: |
43-
type=schedule
4426
type=ref,event=branch
4527
type=ref,event=pr
4628
type=semver,pattern=v{{version}}
4729
type=semver,pattern=v{{major}}.{{minor}}
4830
type=semver,pattern=v{{major}}
4931
type=sha
32+
type=raw,value=latest
5033
- name: Set up QEMU
51-
uses: docker/setup-qemu-action@v1
34+
uses: docker/setup-qemu-action@v3
5235
- name: Set up Docker Buildx
53-
uses: docker/setup-buildx-action@v1
36+
uses: docker/setup-buildx-action@v3
5437
- name: Login to DockerHub
5538
if: github.event_name != 'pull_request'
56-
uses: docker/login-action@v1
39+
uses: docker/login-action@v3
5740
with:
5841
username: ${{ secrets.DOCKER_HUB_USER }}
5942
password: ${{ secrets.DOCKER_HUB_SECRETS }}
60-
- name: Login to GHCR
61-
if: github.event_name != 'pull_request'
62-
uses: docker/login-action@v1
63-
with:
64-
registry: ghcr.io
65-
username: ${{ github.repository_owner }}
66-
password: ${{ secrets.GHCR_TOKEN }}
6743
- name: Build and push Docker images
68-
uses: docker/[email protected]
69-
if: github.repository_owner == 'kubesphere'
70-
with:
71-
context: java/images/centos-java11
72-
tags: ${{ steps.meta.outputs.tags }}
73-
push: ${{ github.event_name != 'pull_request' }}
74-
labels: ${{ steps.meta.outputs.labels }}
75-
platforms: linux/amd64,linux/arm64
76-
- name: Build and push Docker images for Contributors
77-
uses: docker/[email protected]
78-
if: github.repository_owner != 'kubesphere'
44+
uses: docker/build-push-action@v6
7945
with:
8046
context: java/images/centos-java11
81-
tags: ${{ steps.metaContributors.outputs.tags }}
82-
push: ${{ github.event_name != 'pull_request' }}
83-
labels: ${{ steps.metaContributors.outputs.labels }}
84-
platforms: linux/amd64,linux/arm64
85-
86-
BuildCentOSJava8:
87-
runs-on: ubuntu-20.04
88-
steps:
89-
- uses: actions/checkout@v2
90-
- name: Docker meta for KubeSphere
91-
id: meta
92-
if: github.repository_owner == 'kubesphere'
93-
uses: docker/metadata-action@v3
94-
with:
95-
images: |
96-
kubespheredev/java-8-centos7
97-
ghcr.io/${{ github.repository_owner }}/java-8-centos7
98-
tags: |
99-
type=schedule
100-
type=ref,event=branch
101-
type=ref,event=pr
102-
type=semver,pattern=v{{version}}
103-
type=semver,pattern=v{{major}}.{{minor}}
104-
type=semver,pattern=v{{major}}
105-
type=sha
106-
- name: Docker meta for Contributors
107-
id: metaContributors
108-
if: github.repository_owner != 'kubesphere'
109-
uses: docker/metadata-action@v3
110-
with:
111-
images: |
112-
ghcr.io/${{ github.repository_owner }}/java-8-centos7
113-
tags: |
114-
type=schedule
115-
type=ref,event=branch
116-
type=ref,event=pr
117-
type=semver,pattern=v{{version}}
118-
type=semver,pattern=v{{major}}.{{minor}}
119-
type=semver,pattern=v{{major}}
120-
type=sha
121-
- name: Set up QEMU
122-
uses: docker/setup-qemu-action@v1
123-
- name: Set up Docker Buildx
124-
uses: docker/setup-buildx-action@v1
125-
- name: Login to DockerHub
126-
if: github.event_name != 'pull_request'
127-
uses: docker/login-action@v1
128-
with:
129-
username: ${{ secrets.DOCKER_HUB_USER }}
130-
password: ${{ secrets.DOCKER_HUB_SECRETS }}
131-
- name: Login to GHCR
132-
if: github.event_name != 'pull_request'
133-
uses: docker/login-action@v1
134-
with:
135-
registry: ghcr.io
136-
username: ${{ github.repository_owner }}
137-
password: ${{ secrets.GHCR_TOKEN }}
138-
- name: Build and push Docker images
139-
uses: docker/[email protected]
140-
if: github.repository_owner == 'kubesphere'
141-
with:
142-
context: java/images/centos
14347
tags: ${{ steps.meta.outputs.tags }}
14448
push: ${{ github.event_name != 'pull_request' }}
14549
labels: ${{ steps.meta.outputs.labels }}
146-
platforms: linux/amd64,linux/arm64
147-
- name: Build and push Docker images for Contributors
148-
uses: docker/[email protected]
149-
if: github.repository_owner != 'kubesphere'
150-
with:
151-
context: java/images/centos
152-
tags: ${{ steps.metaContributors.outputs.tags }}
153-
push: ${{ github.event_name != 'pull_request' }}
154-
labels: ${{ steps.metaContributors.outputs.labels }}
155-
platforms: linux/amd64,linux/arm64
50+
platforms: linux/amd64
15651

157-
BuildTomcatJava8:
158-
runs-on: ubuntu-20.04
159-
needs: BuildCentOSJava8
160-
steps:
161-
- uses: actions/checkout@v2
162-
- name: Docker meta for KubeSphere
163-
id: meta
164-
if: github.repository_owner == 'kubesphere'
165-
uses: docker/metadata-action@v3
166-
with:
167-
images: |
168-
kubespheredev/tomcat85-java8-centos7
169-
ghcr.io/${{ github.repository_owner }}/tomcat85-java8-centos7
170-
tags: |
171-
type=schedule
172-
type=ref,event=branch
173-
type=ref,event=pr
174-
type=semver,pattern=v{{version}}
175-
type=semver,pattern=v{{major}}.{{minor}}
176-
type=semver,pattern=v{{major}}
177-
type=sha
178-
- name: Docker meta for Contributors
179-
id: metaContributors
180-
if: github.repository_owner != 'kubesphere'
181-
uses: docker/metadata-action@v3
182-
with:
183-
images: |
184-
ghcr.io/${{ github.repository_owner }}/tomcat85-java8-centos7
185-
tags: |
186-
type=schedule
187-
type=ref,event=branch
188-
type=ref,event=pr
189-
type=semver,pattern=v{{version}}
190-
type=semver,pattern=v{{major}}.{{minor}}
191-
type=semver,pattern=v{{major}}
192-
type=sha
193-
- name: Set up QEMU
194-
uses: docker/setup-qemu-action@v1
195-
- name: Set up Docker Buildx
196-
uses: docker/setup-buildx-action@v1
197-
- name: Login to DockerHub
198-
if: github.event_name != 'pull_request'
199-
uses: docker/login-action@v1
200-
with:
201-
username: ${{ secrets.DOCKER_HUB_USER }}
202-
password: ${{ secrets.DOCKER_HUB_SECRETS }}
203-
- name: Login to GHCR
204-
if: github.event_name != 'pull_request'
205-
uses: docker/login-action@v1
206-
with:
207-
registry: ghcr.io
208-
username: ${{ github.repository_owner }}
209-
password: ${{ secrets.GHCR_TOKEN }}
210-
- name: Build and push Docker images
211-
uses: docker/[email protected]
212-
if: github.repository_owner == 'kubesphere'
213-
with:
214-
context: tomcat/images/tomcat85-java8-centos7
215-
tags: ${{ steps.meta.outputs.tags }}
216-
push: ${{ github.event_name != 'pull_request' }}
217-
labels: ${{ steps.meta.outputs.labels }}
218-
platforms: linux/amd64,linux/arm64
219-
- name: Build and push Docker images for Contributors
220-
uses: docker/[email protected]
221-
if: github.repository_owner != 'kubesphere'
222-
with:
223-
context: tomcat/images/tomcat85-java8-centos7
224-
tags: ${{ steps.metaContributors.outputs.tags }}
225-
push: ${{ github.event_name != 'pull_request' }}
226-
labels: ${{ steps.metaContributors.outputs.labels }}
227-
platforms: linux/amd64,linux/arm64
228-
229-
BuildTomcatJava11:
230-
runs-on: ubuntu-20.04
231-
needs: BuildCentOSJava11
232-
steps:
233-
- uses: actions/checkout@v2
234-
- name: Docker meta for KubeSphere
235-
id: meta
236-
if: github.repository_owner == 'kubesphere'
237-
uses: docker/metadata-action@v3
238-
with:
239-
images: |
240-
kubespheredev/tomcat85-java11-centos7
241-
ghcr.io/${{ github.repository_owner }}/tomcat85-java11-centos7
242-
tags: |
243-
type=schedule
244-
type=ref,event=branch
245-
type=ref,event=pr
246-
type=semver,pattern=v{{version}}
247-
type=semver,pattern=v{{major}}.{{minor}}
248-
type=semver,pattern=v{{major}}
249-
type=sha
250-
- name: Docker meta for Contributors
251-
id: metaContributors
252-
if: github.repository_owner != 'kubesphere'
253-
uses: docker/metadata-action@v3
254-
with:
255-
images: |
256-
ghcr.io/${{ github.repository_owner }}/tomcat85-java11-centos7
257-
tags: |
258-
type=schedule
259-
type=ref,event=branch
260-
type=ref,event=pr
261-
type=semver,pattern=v{{version}}
262-
type=semver,pattern=v{{major}}.{{minor}}
263-
type=semver,pattern=v{{major}}
264-
type=sha
265-
- name: Set up QEMU
266-
uses: docker/setup-qemu-action@v1
267-
- name: Set up Docker Buildx
268-
uses: docker/setup-buildx-action@v1
269-
- name: Login to DockerHub
270-
if: github.event_name != 'pull_request'
271-
uses: docker/login-action@v1
272-
with:
273-
username: ${{ secrets.DOCKER_HUB_USER }}
274-
password: ${{ secrets.DOCKER_HUB_SECRETS }}
275-
- name: Login to GHCR
276-
if: github.event_name != 'pull_request'
277-
uses: docker/login-action@v1
278-
with:
279-
registry: ghcr.io
280-
username: ${{ github.repository_owner }}
281-
password: ${{ secrets.GHCR_TOKEN }}
282-
- name: Build and push Docker images
283-
uses: docker/[email protected]
284-
if: github.repository_owner == 'kubesphere'
285-
with:
286-
context: tomcat/images/tomcat85-java11-centos7
287-
tags: ${{ steps.meta.outputs.tags }}
288-
push: ${{ github.event_name != 'pull_request' }}
289-
labels: ${{ steps.meta.outputs.labels }}
290-
platforms: linux/amd64,linux/arm64
291-
- name: Build and push Docker images for Contributors
292-
uses: docker/[email protected]
293-
if: github.repository_owner != 'kubesphere'
294-
with:
295-
context: tomcat/images/tomcat85-java11-centos7
296-
tags: ${{ steps.metaContributors.outputs.tags }}
297-
push: ${{ github.event_name != 'pull_request' }}
298-
labels: ${{ steps.metaContributors.outputs.labels }}
299-
platforms: linux/amd64,linux/arm64

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"java.compile.nullAnalysis.mode": "disabled"
3+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<body>
4+
<h2>Hello world!</h2>
5+
<p>
6+
By <a href="https://kubesphere.io">KubeSphere</a>!
7+
</p>
8+
</body>
9+
</html>

java/images/centos-java11/Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM centos:7
1+
FROM quay.io/centos/centos:10
22

33
ARG EXPOSE_PORT=8080
44
EXPOSE ${EXPOSE_PORT}
@@ -42,8 +42,8 @@ RUN yum -y update \
4242
tar -xzf - -C /opt \
4343
&& ln -s /opt/apache-maven-3.6.0 /opt/maven \
4444
&& ln -s /opt/maven/bin/mvn /usr/bin/mvn \
45-
&& groupadd -r jboss -g 1000 \
46-
&& useradd -u 1000 -r -g jboss -m -d /opt/jboss -s /sbin/nologin -c "JBoss user" jboss \
45+
&& groupadd -r jboss -g 1001 \
46+
&& useradd -u 1001 -r -g jboss -m -d /opt/jboss -s /sbin/nologin -c "JBoss user" jboss \
4747
&& chmod 755 /opt/jboss
4848

4949
ENV JAVA_HOME /etc/alternatives/jre
@@ -118,7 +118,7 @@ WORKDIR /opt/jboss
118118

119119
# S2I requires a numeric, non-0 UID. This is the UID for the jboss user in the base image
120120

121-
USER 1000
121+
USER 1001
122122
RUN mkdir -p /opt/jboss/.m2
123123
COPY settings.xml /opt/jboss/.m2/settings.xml
124124

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<beans xmlns="http://www.springframework.org/schema/beans"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xmlns:mvc="http://www.springframework.org/schema/mvc"
5+
xmlns:context="http://www.springframework.org/schema/context"
6+
xmlns:jdbc="http://www.springframework.org/schema/jdbc"
7+
xmlns:util="http://www.springframework.org/schema/util"
8+
xmlns:p="http://www.springframework.org/schema/p"
9+
xmlns:tx="http://www.springframework.org/schema/tx"
10+
xmlns:cache="http://www.springframework.org/schema/cache"
11+
xsi:schemaLocation="http://www.springframework.org/schema/mvc
12+
http://www.springframework.org/schema/mvc/spring-mvc.xsd
13+
http://www.springframework.org/schema/beans
14+
http://www.springframework.org/schema/beans/spring-beans.xsd
15+
http://www.springframework.org/schema/context
16+
http://www.springframework.org/schema/context/spring-context.xsd
17+
http://www.springframework.org/schema/jdbc
18+
http://www.springframework.org/schema/jdbc/spring-jdbc.xsd
19+
http://www.springframework.org/schema/util
20+
http://www.springframework.org/schema/util/spring-util.xsd
21+
http://www.springframework.org/schema/tx
22+
http://www.springframework.org/schema/tx/spring-tx.xsd
23+
http://www.springframework.org/schema/cache
24+
http://www.springframework.org/schema/cache/spring-cache.xsd"
25+
default-autowire="byName">
26+
27+
<mvc:resources mapping="/library/**" location="/library/" />
28+
29+
<!-- Scans within the base package of the application for @Components to
30+
configure as beans -->
31+
<!-- @Controller, @Service, @Configuration, etc. -->
32+
<context:component-scan base-package="me.brucephillips" />
33+
34+
<context:annotation-config />
35+
36+
37+
<!-- Enables the Spring MVC @Controller programming model -->
38+
<mvc:annotation-driven></mvc:annotation-driven>
39+
40+
<tx:annotation-driven />
41+
42+
43+
44+
</beans>

0 commit comments

Comments
 (0)