Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,31 @@ jobs:
if: contains(github.ref, 'refs/heads/master') && env.REGISTRY_USERNAME != ''
run: DOCKER_TAG=ubuntu1804-jdk11 make push

ubuntu2004:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[ci skip]')"
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Build ubuntu2004
run: make ubuntu2004

- name: Test ubuntu2004
if: "!contains(github.ref, 'refs/heads/master')"
run: ./scripts/test.sh ubuntu2004 refs/heads/4.13 ""

- name: Login to Docker
uses: docker/login-action@v1
if: contains(github.ref, 'refs/heads/master') && env.REGISTRY_USERNAME != ''
with:
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}

- name: Push ubuntu2004
if: contains(github.ref, 'refs/heads/master') && env.REGISTRY_USERNAME != ''
run: DOCKER_TAG=ubuntu2004 make push

latest:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[ci skip]')"
Expand Down
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,15 @@ ubuntu1804-jdk11: ## Build ubuntu1804-jdk11 image
@ $(MAKE) --no-print-directory log-$@
$(call build_tag,ubuntu1804-jdk11,ubuntu1804-jdk11)

.PHONY: ubuntu2004
ubuntu2004: ## Build ubuntu2004 image
@ $(MAKE) --no-print-directory log-$@
$(call build_tag,ubuntu2004,ubuntu2004)

.PHONY: latest
latest: ## Build latest image
@ $(MAKE) --no-print-directory log-$@
$(call build_tag,latest,ubuntu1804)
$(call build_tag,latest,ubuntu2004)

.PHONY: push
push: DOCKER_TAG ?=
Expand Down
26 changes: 15 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ for releases. A very good candidate to be used by the Jenkins slaves of the proj

## Supported tags and respective `Dockerfile` links

- [`latest`, `ubuntu1804` (ubuntu1804/Dockerfile)][latest-dockerfile]
- [`latest`, `ubuntu2004` (ubuntu2004/Dockerfile)][ubuntu2004-dockerfile]
- [`ubuntu2004-jdk11` (ubuntu2004-jdk11/Dockerfile)][ubuntu2004-jdk11-dockerfile]
- [`ubuntu1804` (ubuntu1804/Dockerfile)][ubuntu1804-dockerfile]
- [`ubuntu1804-jdk11` (ubuntu1804-jdk11/Dockerfile)][ubuntu1804-jdk11-dockerfile]
- [`ubuntu1604` (ubuntu1604/Dockerfile)][ubuntu1604-dockerfile]
- [`ubuntu1404` (ubuntu1404/Dockerfile)][ubuntu1404-dockerfile]
Expand Down Expand Up @@ -57,14 +59,14 @@ required:

### Pull Docker images

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

```bashe
docker pull khos2ow/cloudstack-deb-builder:ubuntu1604
docker pull khos2ow/cloudstack-deb-builder:ubuntu2004
```

You can replace `ubuntu1604` tag by `ubuntu1804`, `ubuntu1404` or `latest` if
You can replace `ubuntu2004` tag by `ubuntu1804`, `ubuntu1404` or `latest` if
you want.

### Build local repository
Expand Down Expand Up @@ -92,7 +94,7 @@ always expects the `cloudstack` code exists in `/mnt/build` path.)
```bash
docker run \
-v /tmp:/mnt/build \
khos2ow/cloudstack-deb-builder:ubuntu1604 [ARGS...]
khos2ow/cloudstack-deb-builder:ubuntu2004 [ARGS...]
```

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

After the build has finished the `.deb` packages are available in
Expand All @@ -125,7 +127,7 @@ in `/mnt/build/cloudstack` inside the container and can be accessed from
```bash
docker run \
-v /tmp:/mnt/build \
khos2ow/cloudstack-deb-builder:ubuntu1604 \
khos2ow/cloudstack-deb-builder:ubuntu2004 \
--git-remote https://github.com/apache/cloudstack.git \
--git-ref master \
[ARGS...]
Expand Down Expand Up @@ -155,7 +157,7 @@ it run faster.
docker run \
-v /tmp:/mnt/build \
-v ~/.m2:/root/.m2 \
khos2ow/cloudstack-deb-builder:ubuntu1604 [ARGS...]
khos2ow/cloudstack-deb-builder:ubuntu2004 [ARGS...]
```

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

## Builder help
Expand All @@ -185,7 +187,7 @@ To see all the available options you can pass to `docker run ...` command:
```bash
docker run \
-v /tmp:/mnt/build \
khos2ow/cloudstack-deb-builder:ubuntu1604 --help
khos2ow/cloudstack-deb-builder:ubuntu2004 --help
```

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

[Apache License version 2.0]: http://www.apache.org/licenses/LICENSE-2.0
[LICENSE]: https://github.com/khos2ow/cloudstack-deb-builder/blob/master/LICENSE
[latest-dockerfile]: https://github.com/khos2ow/cloudstack-deb-builder/blob/master/ubuntu1804/Dockerfile
[ubuntu1404-dockerfile]: https://github.com/khos2ow/cloudstack-deb-builder/blob/master/ubuntu1404/Dockerfile
[ubuntu1604-dockerfile]: https://github.com/khos2ow/cloudstack-deb-builder/blob/master/ubuntu1604/Dockerfile
[ubuntu1804-dockerfile]: https://github.com/khos2ow/cloudstack-deb-builder/blob/master/ubuntu1804/Dockerfile
[ubuntu1804-jdk11-dockerfile]: https://github.com/khos2ow/cloudstack-deb-builder/blob/master/ubuntu1804-jdk11/Dockerfile
[ubuntu2004-dockerfile]: https://github.com/khos2ow/cloudstack-deb-builder/blob/master/ubuntu2004/Dockerfile
[ubuntu2004-jdk11-dockerfile]: https://github.com/khos2ow/cloudstack-deb-builder/blob/master/ubuntu2004-jdk11/Dockerfile
[https://github.com/apache/cloudstack]: https://github.com/apache/cloudstack
52 changes: 52 additions & 0 deletions ubuntu2004/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

FROM ubuntu:20.04
LABEL maintainer="Khosrow Moossavi <me@khosrow.io> (@khos2ow)"

RUN apt-get update -y && \
apt-get install -y --no-install-recommends \
make \
locate \
tar \
lsb-release \
build-essential \
dpkg-dev \
devscripts \
debhelper \
genisoimage \
git \
maven \
openjdk-8-jdk \
python \
python-mysqldb \
python-mysql.connector \
dh-systemd \
python-setuptools && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* && \
update-java-alternatives -s java-1.8.0-openjdk-amd64

ENV JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-amd64

VOLUME /mnt/build
WORKDIR /mnt/build

COPY docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
COPY environment-info.sh /usr/local/bin/environment-info.sh

ENTRYPOINT ["docker-entrypoint.sh"]
Loading