Skip to content

Commit 7ff3fb8

Browse files
committed
Add Ubuntu 20.04 image
1 parent 8edb29f commit 7ff3fb8

File tree

6 files changed

+391
-13
lines changed

6 files changed

+391
-13
lines changed

.circleci/config.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,13 @@ jobs:
5454
TAG: ubuntu1804
5555
PARAMS: ""
5656

57+
ubuntu2004:
58+
<<: *defaults
59+
environment:
60+
IMAGE: khos2ow/cloudstack-deb-builder
61+
TAG: ubuntu2004
62+
PARAMS: ""
63+
5764
latest:
5865
<<: *defaults
5966
environment:
@@ -80,6 +87,11 @@ workflows:
8087
tags:
8188
only: /v.*/
8289

90+
- ubuntu2004:
91+
filters:
92+
tags:
93+
only: /v.*/
94+
8395
- latest:
8496
filters:
8597
tags:

Makefile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717

18-
.PHONY: all ubuntu1404 ubuntu1604 ubuntu1804 latest
18+
.PHONY: all ubuntu1404 ubuntu1604 ubuntu1804 ubuntu2004 latest
1919

2020
# Build docker tag based on provided info
2121
#
@@ -25,7 +25,7 @@ define build_tag
2525
docker build -t khos2ow/cloudstack-deb-builder:$(1) $(2)
2626
endef
2727

28-
all: ubuntu1404 ubuntu1604 ubuntu1804 latest
28+
all: ubuntu1404 ubuntu1604 ubuntu1804 ubuntu2004 latest
2929

3030
ubuntu1404:
3131
$(call build_tag,ubuntu1404,ubuntu1404)
@@ -36,5 +36,8 @@ ubuntu1604:
3636
ubuntu1804:
3737
$(call build_tag,ubuntu1804,ubuntu1804)
3838

39+
ubuntu2004:
40+
$(call build_tag,ubuntu2004,ubuntu2004)
41+
3942
latest:
40-
$(call build_tag,latest,ubuntu1804)
43+
$(call build_tag,latest,ubuntu2004)

README.md

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ This will give portable, immutable and reproducable mechanism to build packages
2828

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

31-
- [`latest`, `ubuntu1804` (ubuntu1804/Dockerfile)](https://github.com/khos2ow/cloudstack-deb-builder/blob/master/ubuntu1804/Dockerfile)
31+
- [`latest`, `ubuntu2004` (ubuntu2004/Dockerfile)](https://github.com/khos2ow/cloudstack-deb-builder/blob/master/ubuntu2004/Dockerfile)
32+
- [`ubuntu1804` (ubuntu1804/Dockerfile)](https://github.com/khos2ow/cloudstack-deb-builder/blob/master/ubuntu1804/Dockerfile)
3233
- [`ubuntu1604` (ubuntu1604/Dockerfile)](https://github.com/khos2ow/cloudstack-deb-builder/blob/master/ubuntu1604/Dockerfile)
3334
- [`ubuntu1404` (ubuntu1404/Dockerfile)](https://github.com/khos2ow/cloudstack-deb-builder/blob/master/ubuntu1404/Dockerfile)
3435

@@ -56,11 +57,11 @@ Building DEB packages with the Docker container is rather easy, a few steps are
5657

5758
### Pull Docker images
5859

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

61-
docker pull khos2ow/cloudstack-deb-builder:ubuntu1604
62+
docker pull khos2ow/cloudstack-deb-builder:ubuntu2004
6263

63-
You can replace `ubuntu1604` tag by `ubuntu1804`, `ubuntu1404` or `latest` if you want.
64+
You can replace `ubuntu2004` tag by `ubuntu1804`, `ubuntu1604`, `ubuntu1404` or `latest` if you want.
6465

6566
### Build local repository
6667

@@ -80,13 +81,13 @@ Now that we have cloned the CloudStack source code locally, we can build package
8081

8182
docker run \
8283
-v /tmp:/mnt/build \
83-
khos2ow/cloudstack-deb-builder:ubuntu1604 [ARGS...]
84+
khos2ow/cloudstack-deb-builder:ubuntu2004 [ARGS...]
8485

8586
Or if your local cloudstack folder has other name, you need to map it to `/mnt/build/cloudstack`.
8687

8788
docker run \
8889
-v /tmp/cloudstack-custom-name:/mnt/build/cloudstack \
89-
khos2ow/cloudstack-deb-builder:ubuntu1604 [ARGS...]
90+
khos2ow/cloudstack-deb-builder:ubuntu2004 [ARGS...]
9091

9192
After the build has finished the *.deb* packages are available in */tmp/cloudstack/dist/debbuild/DEBS* on the host system.
9293

@@ -100,7 +101,7 @@ Now let's assume we want to build packages of `HEAD` of `master` branch from htt
100101

101102
docker run \
102103
-v /tmp:/mnt/build \
103-
khos2ow/cloudstack-deb-builder:ubuntu1604 \
104+
khos2ow/cloudstack-deb-builder:ubuntu2004 \
104105
--git-remote https://github.com/apache/cloudstack.git \
105106
--git-ref master \
106107
[ARGS...]
@@ -126,7 +127,7 @@ You can provide Maven cache folder (`~/.m2`) as a volume to the container to mak
126127
docker run \
127128
-v /tmp:/mnt/build \
128129
-v ~/.m2:/root/.m2 \
129-
khos2ow/cloudstack-deb-builder:ubuntu1604 [ARGS...]
130+
khos2ow/cloudstack-deb-builder:ubuntu2004 [ARGS...]
130131

131132
### Adjust host owner permission
132133

@@ -138,15 +139,15 @@ This is specially useful if you want to use this image in Jenkins job and want t
138139
-v /tmp:/mnt/build \
139140
-e "USER_ID=$(id -u)" \
140141
-e "USER_GID=$(id -g)" \
141-
khos2ow/cloudstack-deb-builder:ubuntu1604 [ARGS...]
142+
khos2ow/cloudstack-deb-builder:ubuntu2004 [ARGS...]
142143

143144
## Builder help
144145

145146
To see all the available options you can pass to `docker run ...` command:
146147

147148
docker run \
148149
-v /tmp:/mnt/build \
149-
khos2ow/cloudstack-deb-builder:ubuntu1604 --help
150+
khos2ow/cloudstack-deb-builder:ubuntu2004 --help
150151

151152
## License
152153

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 <[email protected]> (@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)