Skip to content

Commit 3e8c210

Browse files
committed
Add Ubuntu 20.04 image
Signed-off-by: Khosrow Moossavi <khos2ow@gmail.com>
1 parent 9ddc95f commit 3e8c210

File tree

6 files changed

+408
-12
lines changed

6 files changed

+408
-12
lines changed

.github/workflows/ci.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,31 @@ jobs:
110110
if: contains(github.ref, 'refs/heads/master') && env.REGISTRY_USERNAME != ''
111111
run: DOCKER_TAG=ubuntu1804-jdk11 make push
112112

113+
ubuntu2004:
114+
runs-on: ubuntu-latest
115+
if: "!contains(github.event.head_commit.message, '[ci skip]')"
116+
steps:
117+
- name: Checkout
118+
uses: actions/checkout@v2
119+
120+
- name: Build ubuntu2004
121+
run: make ubuntu2004
122+
123+
- name: Test ubuntu2004
124+
if: "!contains(github.ref, 'refs/heads/master')"
125+
run: ./scripts/test.sh ubuntu2004 refs/heads/4.13 ""
126+
127+
- name: Login to Docker
128+
uses: docker/login-action@v1
129+
if: contains(github.ref, 'refs/heads/master') && env.REGISTRY_USERNAME != ''
130+
with:
131+
username: ${{ secrets.REGISTRY_USERNAME }}
132+
password: ${{ secrets.REGISTRY_PASSWORD }}
133+
134+
- name: Push ubuntu2004
135+
if: contains(github.ref, 'refs/heads/master') && env.REGISTRY_USERNAME != ''
136+
run: DOCKER_TAG=ubuntu2004 make push
137+
113138
latest:
114139
runs-on: ubuntu-latest
115140
if: "!contains(github.event.head_commit.message, '[ci skip]')"

Makefile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,15 @@ ubuntu1804-jdk11: ## Build ubuntu1804-jdk11 image
5353
@ $(MAKE) --no-print-directory log-$@
5454
$(call build_tag,ubuntu1804-jdk11,ubuntu1804-jdk11)
5555

56+
.PHONY: ubuntu2004
57+
ubuntu2004: ## Build ubuntu2004 image
58+
@ $(MAKE) --no-print-directory log-$@
59+
$(call build_tag,ubuntu2004,ubuntu2004)
60+
5661
.PHONY: latest
5762
latest: ## Build latest image
5863
@ $(MAKE) --no-print-directory log-$@
59-
$(call build_tag,latest,ubuntu1804)
64+
$(call build_tag,latest,ubuntu2004)
6065

6166
.PHONY: push
6267
push: DOCKER_TAG ?=

README.md

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ for releases. A very good candidate to be used by the Jenkins slaves of the proj
2727

2828
## Supported tags and respective `Dockerfile` links
2929

30-
- [`latest`, `ubuntu1804` (ubuntu1804/Dockerfile)][latest-dockerfile]
30+
- [`latest`, `ubuntu2004` (ubuntu2004/Dockerfile)][ubuntu2004-dockerfile]
31+
- [`ubuntu2004-jdk11` (ubuntu2004-jdk11/Dockerfile)][ubuntu2004-jdk11-dockerfile]
32+
- [`ubuntu1804` (ubuntu1804/Dockerfile)][ubuntu1804-dockerfile]
3133
- [`ubuntu1804-jdk11` (ubuntu1804-jdk11/Dockerfile)][ubuntu1804-jdk11-dockerfile]
3234
- [`ubuntu1604` (ubuntu1604/Dockerfile)][ubuntu1604-dockerfile]
3335
- [`ubuntu1404` (ubuntu1404/Dockerfile)][ubuntu1404-dockerfile]
@@ -57,14 +59,14 @@ required:
5759

5860
### Pull Docker images
5961

60-
Let's assume we want to build packages for Ubuntu 16.04 (Xenial). We pull that
62+
Let's assume we want to build packages for Ubuntu 20.04 (Focal). We pull that
6163
image first:
6264

6365
```bashe
64-
docker pull khos2ow/cloudstack-deb-builder:ubuntu1604
66+
docker pull khos2ow/cloudstack-deb-builder:ubuntu2004
6567
```
6668

67-
You can replace `ubuntu1604` tag by `ubuntu1804`, `ubuntu1404` or `latest` if
69+
You can replace `ubuntu2004` tag by `ubuntu1804`, `ubuntu1404` or `latest` if
6870
you want.
6971

7072
### Build local repository
@@ -92,7 +94,7 @@ always expects the `cloudstack` code exists in `/mnt/build` path.)
9294
```bash
9395
docker run \
9496
-v /tmp:/mnt/build \
95-
khos2ow/cloudstack-deb-builder:ubuntu1604 [ARGS...]
97+
khos2ow/cloudstack-deb-builder:ubuntu2004 [ARGS...]
9698
```
9799

98100
Or if your local cloudstack folder has other name, you need to map it to
@@ -101,7 +103,7 @@ Or if your local cloudstack folder has other name, you need to map it to
101103
```bash
102104
docker run \
103105
-v /tmp/cloudstack-custom-name:/mnt/build/cloudstack \
104-
khos2ow/cloudstack-deb-builder:ubuntu1604 [ARGS...]
106+
khos2ow/cloudstack-deb-builder:ubuntu2004 [ARGS...]
105107
```
106108

107109
After the build has finished the `.deb` packages are available in
@@ -125,7 +127,7 @@ in `/mnt/build/cloudstack` inside the container and can be accessed from
125127
```bash
126128
docker run \
127129
-v /tmp:/mnt/build \
128-
khos2ow/cloudstack-deb-builder:ubuntu1604 \
130+
khos2ow/cloudstack-deb-builder:ubuntu2004 \
129131
--git-remote https://github.com/apache/cloudstack.git \
130132
--git-ref master \
131133
[ARGS...]
@@ -155,7 +157,7 @@ it run faster.
155157
docker run \
156158
-v /tmp:/mnt/build \
157159
-v ~/.m2:/root/.m2 \
158-
khos2ow/cloudstack-deb-builder:ubuntu1604 [ARGS...]
160+
khos2ow/cloudstack-deb-builder:ubuntu2004 [ARGS...]
159161
```
160162

161163
### Adjust host owner permission
@@ -175,7 +177,7 @@ docker run \
175177
-v /tmp:/mnt/build \
176178
-e "USER_ID=$(id -u)" \
177179
-e "USER_GID=$(id -g)" \
178-
khos2ow/cloudstack-deb-builder:ubuntu1604 [ARGS...]
180+
khos2ow/cloudstack-deb-builder:ubuntu2004 [ARGS...]
179181
```
180182

181183
## Builder help
@@ -185,7 +187,7 @@ To see all the available options you can pass to `docker run ...` command:
185187
```bash
186188
docker run \
187189
-v /tmp:/mnt/build \
188-
khos2ow/cloudstack-deb-builder:ubuntu1604 --help
190+
khos2ow/cloudstack-deb-builder:ubuntu2004 --help
189191
```
190192

191193
## License
@@ -195,8 +197,10 @@ included in the root directory of the source tree for extended license details.
195197

196198
[Apache License version 2.0]: http://www.apache.org/licenses/LICENSE-2.0
197199
[LICENSE]: https://github.com/khos2ow/cloudstack-deb-builder/blob/master/LICENSE
198-
[latest-dockerfile]: https://github.com/khos2ow/cloudstack-deb-builder/blob/master/ubuntu1804/Dockerfile
199200
[ubuntu1404-dockerfile]: https://github.com/khos2ow/cloudstack-deb-builder/blob/master/ubuntu1404/Dockerfile
200201
[ubuntu1604-dockerfile]: https://github.com/khos2ow/cloudstack-deb-builder/blob/master/ubuntu1604/Dockerfile
202+
[ubuntu1804-dockerfile]: https://github.com/khos2ow/cloudstack-deb-builder/blob/master/ubuntu1804/Dockerfile
201203
[ubuntu1804-jdk11-dockerfile]: https://github.com/khos2ow/cloudstack-deb-builder/blob/master/ubuntu1804-jdk11/Dockerfile
204+
[ubuntu2004-dockerfile]: https://github.com/khos2ow/cloudstack-deb-builder/blob/master/ubuntu2004/Dockerfile
205+
[ubuntu2004-jdk11-dockerfile]: https://github.com/khos2ow/cloudstack-deb-builder/blob/master/ubuntu2004-jdk11/Dockerfile
202206
[https://github.com/apache/cloudstack]: https://github.com/apache/cloudstack

ubuntu2004/Dockerfile

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
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 ubuntu:20.04
19+
LABEL maintainer="Khosrow Moossavi <me@khosrow.io> (@khos2ow)"
20+
21+
RUN apt-get update -y && \
22+
apt-get install -y --no-install-recommends \
23+
make \
24+
locate \
25+
tar \
26+
lsb-release \
27+
build-essential \
28+
dpkg-dev \
29+
devscripts \
30+
debhelper \
31+
genisoimage \
32+
git \
33+
maven \
34+
openjdk-8-jdk \
35+
python \
36+
python-mysqldb \
37+
python-mysql.connector \
38+
dh-systemd \
39+
python-setuptools && \
40+
apt-get clean && \
41+
rm -rf /var/lib/apt/lists/* && \
42+
update-java-alternatives -s java-1.8.0-openjdk-amd64
43+
44+
ENV JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-amd64
45+
46+
VOLUME /mnt/build
47+
WORKDIR /mnt/build
48+
49+
COPY docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
50+
COPY environment-info.sh /usr/local/bin/environment-info.sh
51+
52+
ENTRYPOINT ["docker-entrypoint.sh"]

0 commit comments

Comments
 (0)