Skip to content

Commit acef23e

Browse files
committed
Add CentOS8 image
Signed-off-by: Khosrow Moossavi <[email protected]>
1 parent 371b5c0 commit acef23e

File tree

6 files changed

+414
-55
lines changed

6 files changed

+414
-55
lines changed

.github/workflows/ci.yml

Lines changed: 13 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -85,36 +85,19 @@ jobs:
8585
if: contains(github.ref, 'refs/heads/master') && env.REGISTRY_USERNAME != ''
8686
run: DOCKER_TAG=centos7-jdk11 make push
8787

88-
latest:
88+
centos8:
8989
runs-on: ubuntu-latest
9090
if: "!contains(github.event.head_commit.message, '[ci skip]')"
9191
steps:
9292
- name: Checkout
9393
uses: actions/checkout@v2
9494

95-
- name: Build latest
96-
run: make latest
97-
98-
- name: Login to Docker
99-
uses: docker/login-action@v1
100-
if: contains(github.ref, 'refs/heads/master') && env.REGISTRY_USERNAME != ''
101-
with:
102-
username: ${{ secrets.REGISTRY_USERNAME }}
103-
password: ${{ secrets.REGISTRY_PASSWORD }}
104-
105-
- name: Push latest
106-
if: contains(github.ref, 'refs/heads/master') && env.REGISTRY_USERNAME != ''
107-
run: DOCKER_TAG=latest make push
108-
109-
latest-jdk8:
110-
runs-on: ubuntu-latest
111-
if: "!contains(github.event.head_commit.message, '[ci skip]')"
112-
steps:
113-
- name: Checkout
114-
uses: actions/checkout@v2
95+
- name: Build centos8
96+
run: make centos8
11597

116-
- name: Build latest-jdk8
117-
run: make latest-jdk8
98+
- name: Test centos8
99+
if: "!contains(github.ref, 'refs/heads/master')"
100+
run: ./scripts/test.sh centos8 refs/heads/4.15 "--distribution centos8"
118101

119102
- name: Login to Docker
120103
uses: docker/login-action@v1
@@ -123,19 +106,19 @@ jobs:
123106
username: ${{ secrets.REGISTRY_USERNAME }}
124107
password: ${{ secrets.REGISTRY_PASSWORD }}
125108

126-
- name: Push latest-jdk8
109+
- name: Push centos8
127110
if: contains(github.ref, 'refs/heads/master') && env.REGISTRY_USERNAME != ''
128-
run: DOCKER_TAG=latest-jdk8 make push
111+
run: DOCKER_TAG=centos8 make push
129112

130-
latest-jdk11:
113+
latest:
131114
runs-on: ubuntu-latest
132115
if: "!contains(github.event.head_commit.message, '[ci skip]')"
133116
steps:
134117
- name: Checkout
135118
uses: actions/checkout@v2
136119

137-
- name: Build latest-jdk11
138-
run: make latest-jdk11
120+
- name: Build latest
121+
run: make latest
139122

140123
- name: Login to Docker
141124
uses: docker/login-action@v1
@@ -144,6 +127,6 @@ jobs:
144127
username: ${{ secrets.REGISTRY_USERNAME }}
145128
password: ${{ secrets.REGISTRY_PASSWORD }}
146129

147-
- name: Push latest-jdk11
130+
- name: Push latest
148131
if: contains(github.ref, 'refs/heads/master') && env.REGISTRY_USERNAME != ''
149-
run: DOCKER_TAG=latest-jdk11 make push
132+
run: DOCKER_TAG=latest make push

Makefile

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ define build_tag
3232
endef
3333

3434
.PHONY: all
35-
all: centos6 centos7 centos7-jdk8 centos7-jdk11 latest latest-jdk8 latest-jdk11
35+
all: centos6 centos7 centos7-jdk8 centos7-jdk11 centos8 latest
3636

3737
.PHONY: centos6
3838
centos6: ## Build centos6 image
@@ -54,20 +54,15 @@ centos7-jdk11: ## Build centos7-jdk11 image
5454
@ $(MAKE) --no-print-directory log-$@
5555
$(call build_tag,centos7-jdk11,centos7,Dockerfile.jdk11)
5656

57-
.PHONY: latest
58-
latest: ## Build latest image
59-
@ $(MAKE) --no-print-directory log-$@
60-
$(call build_tag,latest,centos7,Dockerfile.jdk8)
61-
62-
.PHONY: latest-jdk8
63-
latest-jdk8: ## Build latest-jdk8 image
57+
.PHONY: centos8
58+
centos8: ## Build centos8 image
6459
@ $(MAKE) --no-print-directory log-$@
65-
$(call build_tag,latest-jdk8,centos7,Dockerfile.jdk8)
60+
$(call build_tag,centos8,centos8,Dockerfile)
6661

67-
.PHONY: latest-jdk11
68-
latest-jdk11: ## Build latest-jdk11 image
62+
.PHONY: latest
63+
latest: ## Build latest image
6964
@ $(MAKE) --no-print-directory log-$@
70-
$(call build_tag,latest-jdk11,centos7,Dockerfile.jdk11)
65+
$(call build_tag,latest,centos8,Dockerfile)
7166

7267
.PHONY: push
7368
push: DOCKER_TAG ?=

README.md

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,9 @@ project.
2929

3030
## Supported tags and respective `Dockerfile` links
3131

32-
- [`latest`, `latest-jdk8`, `centos7`, `centos7-jdk8`(centos7/Dockerfile.jdk8)][centos7-dockerfile]
33-
- [`latest-jdk11`, `centos7-jdk11` (centos7/Dockerfile.jdk11)][latest-jdk11-dockerfile]
32+
- [`latest`, `centos8` (centos8/Dockerfile)][centos8-dockerfile]
33+
- [`centos7`, `centos7-jdk8`(centos7/Dockerfile.jdk8)][centos7-jdk8-dockerfile]
34+
- [`centos7-jdk11` (centos7/Dockerfile.jdk11)][centos7-jdk11-dockerfile]
3435
- [`centos6` (centos6/Dockerfile)][centos6-dockerfile] [EOL - not supported anymore]
3536

3637
## Packages installed in container
@@ -62,10 +63,10 @@ Let's assume we want to build packages for CentOS 7 on CentOS 7. We pull that
6263
image first:
6364

6465
```bash
65-
docker pull khos2ow/cloudstack-rpm-builder:centos7-jdk11
66+
docker pull khos2ow/cloudstack-rpm-builder:centos8
6667
```
6768

68-
You can replace `centos7-jdk11` tag by [one of the other tags].
69+
You can replace `centos8` tag by [one of the other tags].
6970

7071
### Build local repository
7172

@@ -92,7 +93,7 @@ always expects the `cloudstack` code exists in `/mnt/build` path.)
9293
```bash
9394
docker run \
9495
-v /tmp:/mnt/build \
95-
khos2ow/cloudstack-rpm-builder:centos7-jdk11 --distribution centos7 [ARGS...]
96+
khos2ow/cloudstack-rpm-builder:centos8 --distribution centos7 [ARGS...]
9697
```
9798

9899
Or if your local cloudstack folder has other name, you need to map it to
@@ -101,7 +102,7 @@ Or if your local cloudstack folder has other name, you need to map it to
101102
```bash
102103
docker run \
103104
-v /tmp/cloudstack-custom-name:/mnt/build/cloudstack \
104-
khos2ow/cloudstack-rpm-builder:centos7-jdk11 --distribution centos7 [ARGS...]
105+
khos2ow/cloudstack-rpm-builder:centos8 --distribution centos7 [ARGS...]
105106
```
106107

107108
After the build has finished the `.rpm` packages are available in
@@ -125,10 +126,10 @@ flag) in `/mnt/build/cloudstack` inside the container and can be accessed from
125126
```bash
126127
docker run \
127128
-v /tmp:/mnt/build \
128-
khos2ow/cloudstack-rpm-builder:centos7-jdk11 \
129+
khos2ow/cloudstack-rpm-builder:centos8 \
129130
--git-remote https://github.com/apache/cloudstack.git \
130131
--git-ref master \
131-
--distribution centos7 [ARGS...]
132+
--distribution centos8 [ARGS...]
132133
```
133134

134135
Note that any valid git Refspec is acceptable, such as:
@@ -155,7 +156,7 @@ it run faster.
155156
docker run \
156157
-v /tmp:/mnt/build \
157158
-v ~/.m2:/root/.m2 \
158-
khos2ow/cloudstack-rpm-builder:centos7-jdk11 --distribution centos7 [ARGS...]
159+
khos2ow/cloudstack-rpm-builder:centos8 --distribution centos7 [ARGS...]
159160
```
160161

161162
### Adjust host owner permission
@@ -175,7 +176,7 @@ docker run \
175176
-v /tmp:/mnt/build \
176177
-e "USER_ID=$(id -u)" \
177178
-e "USER_GID=$(id -g)" \
178-
khos2ow/cloudstack-rpm-builder:centos7-jdk11 --distribution centos7 [ARGS...]
179+
khos2ow/cloudstack-rpm-builder:centos8 --distribution centos7 [ARGS...]
179180
```
180181

181182
## Builder help
@@ -185,16 +186,17 @@ To see all the available options you can pass to `docker run ...` command:
185186
```bash
186187
docker run \
187188
-v /tmp:/mnt/build \
188-
khos2ow/cloudstack-rpm-builder:centos7-jdk11 --help
189+
khos2ow/cloudstack-rpm-builder:centos8 --help
189190
```
190191

191192
## License
192193

193194
Licensed under [Apache License version 2.0]. Please see the [LICENSE] file
194195
included in the root directory of the source tree for extended license details.
195196

196-
[centos7-dockerfile]: https://github.com/khos2ow/cloudstack-rpm-builder/blob/master/centos7/Dockerfile.jdk8
197-
[latest-jdk11-dockerfile]: https://github.com/khos2ow/cloudstack-rpm-builder/blob/master/centos7/Dockerfile.jdk11
197+
[centos8-dockerfile]: https://github.com/khos2ow/cloudstack-rpm-builder/blob/master/centos8/Dockerfile
198+
[centos7-jdk8-dockerfile]: https://github.com/khos2ow/cloudstack-rpm-builder/blob/master/centos7/Dockerfile.jdk8
199+
[centos7-jdk11-dockerfile]: https://github.com/khos2ow/cloudstack-rpm-builder/blob/master/centos7/Dockerfile.jdk11
198200
[centos6-dockerfile]: https://github.com/khos2ow/cloudstack-rpm-builder/blob/master/centos6/Dockerfile
199201
[one of the other tags]: #supported-tags-and-respective-dockerfile-links
200202
[https://github.com/apache/cloudstack]: https://github.com/apache/cloudstack

centos8/Dockerfile

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
FROM centos:8
19+
LABEL maintainer="Khosrow Moossavi <[email protected]> (@khos2ow)"
20+
21+
RUN \
22+
yum clean metadata && \
23+
yum install -y epel-release && \
24+
yum clean metadata && \
25+
yum install -y \
26+
make \
27+
which \
28+
mlocate \
29+
tar \
30+
rpm-build \
31+
yum-utils \
32+
createrepo \
33+
mkisofs \
34+
git \
35+
java-11-openjdk-devel \
36+
tomcat \
37+
python python3 python-dev py-pip \
38+
python-argparse python-yaml python-pip python-wheel \
39+
mysql-connector-python \
40+
gcc \
41+
gcc-c++ \
42+
jq \
43+
wget \
44+
ws-commons-util && \
45+
yum upgrade python-setuptools && \
46+
pip install --upgrade pip && \
47+
wget http://repos.fedorapeople.org/repos/dchen/apache-maven/epel-apache-maven.repo -O /etc/yum.repos.d/epel-apache-maven.repo && \
48+
yum clean metadata && \
49+
yum install -y \
50+
apache-maven && \
51+
yum clean all && rm -rf /var/cache/yum && \
52+
sed -i "s/%dist .el7$/%dist .el7.centos/g" /etc/rpm/macros.dist
53+
54+
ENV JAVA_HOME=/usr/lib/jvm/java-11
55+
RUN alternatives --set java $(readlink -f ${JAVA_HOME}/bin/java)
56+
57+
VOLUME /mnt/build
58+
WORKDIR /mnt/build
59+
60+
COPY docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
61+
COPY environment-info.sh /usr/local/bin/environment-info.sh
62+
63+
ENTRYPOINT ["docker-entrypoint.sh"]

0 commit comments

Comments
 (0)