Skip to content

Commit 92536fa

Browse files
committed
Add ubuntu2404.v1
1 parent caabdc4 commit 92536fa

File tree

7 files changed

+111
-25
lines changed

7 files changed

+111
-25
lines changed

README.md

Lines changed: 29 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# docker-cloudstack-builder
22

3-
This repository maintains the Dockerfile and scripts to build Apache CloudStack in docker images.
3+
This repository maintains the Dockerfile and scripts to build Apache CloudStack in docker containers.
44

55
Contents
66
=================
@@ -17,11 +17,12 @@ Contents
1717

1818
## Compatibility matrix
1919

20-
| **Docker image** | **CloudStack versions** | **Note** |
21-
|---------------------|-------------------------------|----------------------|
22-
| ubuntu2204.v1 | 4.18.x, 4.19.x | DEB packages for Ubuntu distros |
23-
| rocky8.v1 | 4.18.x, 4.19.x | RPM packages for RHEL/Rocky Linux/AlmaLinux/OracleLinux 8/9 distros |
24-
| centos7.v1 | 4.18.x, 4.19.x | RPM packages for RHEL 7 / CentOS 7 distros |
20+
| **Docker image** | **CloudStack versions** | **Software Versions** | **Note** |
21+
|---------------------|-------------------------------|-----------------------|----------------------|
22+
| **ubuntu2404.v1** | 4.18.x, 4.19.x | JDK 11, nodejs 16 | DEB packages for Ubuntu distros |
23+
| **ubuntu2204.v1** | 4.18.x, 4.19.x | JDK 11, nodejs 14 | DEB packages for Ubuntu distros |
24+
| **rocky8.v1** | 4.18.x, 4.19.x | JDK 11, nodejs 14 | RPM packages for RHEL/Rocky Linux/AlmaLinux/OracleLinux 8/9 distros |
25+
| **centos7.v1** | 4.18.x, 4.19.x | JDK 11, nodejs 14 | RPM packages for RHEL 7 / CentOS 7 distros |
2526

2627
## Usage
2728

@@ -30,8 +31,9 @@ Contents
3031
The pre-built image can be found at https://hub.docker.com/repository/docker/weizhouapache/cloudstack-builder
3132

3233
```
33-
cd ubuntu2204.v1
34-
docker build -f Dockerfile -t weizhouapache/cloudstack-builder:ubuntu2204.v1 .
34+
image=ubuntu2204.v1
35+
cd $image
36+
docker build -f Dockerfile -t weizhouapache/cloudstack-builder:$image .
3537
```
3638

3739
### 1. Build packages with configuration file
@@ -51,10 +53,11 @@ Below are configurations in the configuration file.
5153
| `BUILD_OPTS` | The build options. Refer to `Build Options` | Default: `"-Dnoredist -DskipTests -Dsystemvm-kvm -Dsystemvm-xen -Dsystemvm-vmware -T2"` |
5254
| `PACKAGE_OPTS` | The options for `package.sh` (RPM only) | Default: None |
5355

54-
Samples of environment variables to build latest `main` branch can be found at
55-
- `config.ubuntu.sample`
56-
- `config.rocky8.sample`
57-
- `config.centos7.sample`
56+
Samples of configuration file to build latest `main` branch can be found at
57+
- `config.ubuntu2204.v1.sample`
58+
- `config.ubuntu2404.v1.sample`
59+
- `config.rocky8.v1.sample`
60+
- `config.centos7.v1.sample`
5861

5962
### 2. Build packages with parameters
6063

@@ -74,10 +77,10 @@ Usage: ./build.sh
7477

7578
Examples
7679
```
77-
# Build from a local directory
80+
# Build from a local directory and copy packages to /tmp
7881
./build.sh -i ubuntu2204.v1 -s /data/cloudstack -o /tmp -b "-Dnoredist -DskipTests -Dsystemvm-kvm -Dsystemvm-xen -Dsystemvm-vmware"
7982
80-
# Build from git repository
83+
# Use sudo to build from git repository and copy packages to /tmp
8184
./build.sh -i ubuntu2204.v1 -s https://github.com/apache/cloudstack.git -o /tmp -v main -b "-Dnoredist -DskipTests -Dsystemvm-kvm -Dsystemvm-xen -Dsystemvm-vmware" -u
8285
```
8386

@@ -122,16 +125,17 @@ $SUDO docker run -ti \
122125
-e BUILD_OPTS \
123126
weizhouapache/cloudstack-builder:ubuntu2204.v1
124127
```
128+
125129
## Build Options
126130

127-
| **OS** | **Option** | **Note** |
128-
|-------------|--------------------|----------------------|
129-
| Ubuntu/Rocky8 | -Dnoredist | Support non-Open Source Software (e.g. VMware) |
130-
| | -DskipTests | Skip unit tests |
131-
| | -Dsystemvm-kvm | Bundle with SystemVM template for KVM |
132-
| | -Dsystemvm-vmware | Bundle with SystemVM template for VMware |
133-
| | -Dsystemvm-xen | Bundle with SystemVM template for XenServer/XCP-ng |
134-
| | -T n | Builds with n threads |
131+
| **OS** | **Option** | **Note** |
132+
|--------------|--------------------|----------------------|
133+
| Ubuntu/Rocky | -Dnoredist | Support non-Open Source Software (e.g. VMware) |
134+
| | -DskipTests | Skip unit tests |
135+
| | -Dsystemvm-kvm | Bundle with SystemVM template for KVM |
136+
| | -Dsystemvm-vmware | Bundle with SystemVM template for VMware |
137+
| | -Dsystemvm-xen | Bundle with SystemVM template for XenServer/XCP-ng |
138+
| | -T n | Builds with n threads |
135139

136140

137141
The default value is `-Dnoredist -DskipTests -Dsystemvm-kvm -Dsystemvm-xen -Dsystemvm-vmware -T2`
@@ -140,9 +144,9 @@ The default value is `-Dnoredist -DskipTests -Dsystemvm-kvm -Dsystemvm-xen -Dsys
140144

141145
More details for RPM build can be found at https://github.com/apache/cloudstack/blob/main/packaging/package.sh
142146

143-
| **OS** | **Option** | **Note** |
144-
|-------------|--------------------|----------------------|
145-
| Rocky 8 | -p, --pack | Define which type of libraries to package ("oss"\|"OSS"\|"noredist"\|"NOREDIST") (default "oss") |
147+
| **OS** | **Option** | **Note** |
148+
|-------------|---------------------|----------------------|
149+
| Rocky 8 | -p, --pack | Define which type of libraries to package ("oss"\|"OSS"\|"noredist"\|"NOREDIST") (default "oss") |
146150
| | -T, --use-timestamp | Use epoch timestamp instead of SNAPSHOT in the package name (if not provided, use "SNAPSHOT") |
147151
| | -t, --templates | Passes necessary flag to package the required templates. Comma separated string - kvm,xen,vmware,ovm,hyperv |
148152

config.ubuntu2404.v1.sample

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
# The repository of the image. Default is weizhouapache/cloudstack-builder
3+
REPO=weizhouapache/cloudstack-builder
4+
5+
# The name of the image
6+
IMAGE=ubuntu2404.v1
7+
8+
# The source directory or git repository
9+
# This will be mounted or cloned to /source the docker container.
10+
SOURCE=https://github.com/apache/cloudstack.git
11+
12+
# The directory where the packages will be.
13+
# This will be mounted to /output the docker container.
14+
OUTPUT=/tmp
15+
16+
# The CloudStack version, branch name or commit SHA.
17+
VERSION=main
18+
19+
# The build options.
20+
# The default value for is "-Dnoredist -DskipTests -Dsystemvm-kvm -Dsystemvm-xen -Dsystemvm-vmware"
21+
# Please refer to https://github.com/weizhouapache/docker-cloudstack-builder/blob/main/README.md
22+
BUILD_OPTS=
23+
24+
# Please set to sudo if use a non-root user
25+
SUDO=

ubuntu2404.v1/Dockerfile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
FROM ubuntu:24.04
2+
MAINTAINER Wei Zhou <weizhou@apache.org>
3+
4+
ENV DEBIAN_FRONTEND noninteractive
5+
6+
RUN apt update -qq && \
7+
apt upgrade -y && \
8+
apt-get install -y dpkg-dev python3 debhelper openjdk-11-jdk genisoimage python3-mysql.connector maven lsb-release devscripts python3-setuptools git wget curl
9+
10+
RUN curl -sL https://deb.nodesource.com/setup_16.x | bash - \
11+
&& apt-get install -y nodejs
12+
13+
COPY entrypoint.sh /entrypoint.sh
14+
15+
ENTRYPOINT ["/entrypoint.sh"]

ubuntu2404.v1/entrypoint.sh

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
#!/bin/bash -x
2+
3+
# Print system information
4+
mvn -version
5+
java --version
6+
javac -version
7+
8+
SOURCE_DIR=/source/
9+
OUTPUT_DIR=/output/
10+
BUILD_OPTS_DEFAULT="-Dnoredist -DskipTests -Dsystemvm-kvm -Dsystemvm-xen -Dsystemvm-vmware -T2"
11+
12+
SOURCE=${SOURCE:-}
13+
VERSION=${VERSION:-}
14+
BUILD_OPTS=${BUILD_OPTS:-$BUILD_OPTS_DEFAULT}
15+
16+
if [[ $SOURCE =~ http.* ]] || [[ $SOURCE =~ git.* ]]; then
17+
if [ -d "$SOURCE_DIR" ]; then
18+
echo "$SOURCE_DIR already exists in the container"
19+
exit 1
20+
fi
21+
git clone $SOURCE $SOURCE_DIR
22+
elif [ -z "$SOURCE_DIR" ] || [ ! -d "$SOURCE_DIR" ] || [ ! -f "$SOURCE_DIR/pom.xml" ]; then
23+
echo "Source $SOURCE_DIR does not exist in the container"
24+
exit 1
25+
fi
26+
if [ ! -d "$OUTPUT_DIR" ]; then
27+
echo "$OUTPUT_DIR does not exist in the container"
28+
exit 1
29+
fi
30+
31+
cd $SOURCE_DIR
32+
if [ ! -z "$VERSION" ]; then
33+
git checkout $VERSION
34+
fi
35+
36+
# Packaging
37+
ACS_BUILD_OPTS=$BUILD_OPTS packaging/build-deb.sh
38+
39+
mv $SOURCE_DIR/../cloudstack-*.deb $OUTPUT_DIR
40+
if [[ $SOURCE =~ http.* ]] || [[ $SOURCE =~ git.* ]]; then
41+
rm -rf $SOURCE_DIR
42+
fi

0 commit comments

Comments
 (0)