Skip to content

Repository files navigation

docker-cloudstack-builder

This repository maintains the Dockerfile and scripts to build Apache CloudStack in docker containers.

Contents

Compatibility matrix

Docker imageCloudStack versionsSoftware VersionsNote
ubuntu2404.v24.22.xJDK 17, nodejs 20DEB packages for Ubuntu distros
rocky9.v14.22.xJDK 17, nodejs 20RPM packages for RHEL/Rocky Linux/AlmaLinux/OracleLinux 8/9/10 distros
oraclelinux10.v14.22.xJDK 21, nodejs 20RPM packages for RHEL/Rocky Linux/AlmaLinux/OracleLinux 8/9/10 distros
ubuntu2404.v14.18.x, 4.19.x, 4.20.x, 4.21JDK 11, nodejs 16DEB packages for Ubuntu distros
ubuntu2204.v14.18.x, 4.19.xJDK 11, nodejs 14DEB packages for Ubuntu distros
rocky8.v14.18.x, 4.19.xJDK 11, nodejs 14RPM packages for RHEL/Rocky Linux/AlmaLinux/OracleLinux 8/9 distros
centos7.v14.18.x, 4.19.xJDK 11, nodejs 14RPM packages for RHEL 7 / CentOS 7 distros

Usage

(Optional) Build docker image

The pre-built images can be found at https://hub.docker.com/r/weizhouapache/cloudstack-builder

image=ubuntu2204.v1
cd $image
docker build -f Dockerfile -t weizhouapache/cloudstack-builder:$image .

1. Build packages with configuration file

./build.sh -c <configuration file name>

Below are configurations in the configuration file.

VariabliesDescriptionNote
SOURCEThe directory where the source code is, or the URL of the git repository.Mounted to /source/ if it is a directory
OUTPUTThe directory where the packages will be in.Mounted to /output/ in the docker container
SUDOPlease set to sudo if you use a non-root userDefault: None
VERSIONThe CloudStack version, branch name or commit SHADefault: None
BUILD_OPTSThe build options. Refer to Build OptionsDefault: "-Dnoredist -DskipTests -Dsystemvm-kvm -Dsystemvm-xen -Dsystemvm-vmware -T2"
PACKAGE_OPTSThe options for package.sh (RPM only)Default: None

Samples of configuration file to build latest main branch can be found at

  • config.ubuntu2204.v1.sample
  • config.ubuntu2404.v1.sample
  • config.rocky8.v1.sample
  • config.centos7.v1.sample

2. Build packages with parameters

Usage: ./build.sh
-r <the repository of the image. Default is weizhouapache/cloudstack-builder>
-i <the name of the image>
-s <the source directory or git repository>
-o <the output directory>
-v <the CloudStack version, branch name or commit SHA>
-b <the build options>
-u # use sudo
-c <the name of config file which includes all settings above>
-d # dry-run
-h # help message

Examples

# Build from a local directory and copy packages to /tmp
./build.sh -i ubuntu2204.v1 -s /data/cloudstack -o /tmp -b "-Dnoredist -DskipTests -Dsystemvm-kvm -Dsystemvm-xen -Dsystemvm-vmware"
# Use sudo to build from git repository and copy packages to /tmp
./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

3. Build packages by docker command

An example how to build packages from local directory

SUDO=
SOURCE=./
OUTPUT=/tmp/
CONTAINER_NAME="cloudstack-builder-$(echo $RANDOM | tr '[0-9]' '[a-z]')"
$SUDO mkdir -p ~/.m2/
$SUDO mkdir -p ${OUTPUT}
$SUDO docker run -ti \
-n $CONTAINER_NAME \
-v ~/.m2:/root/.m2/ \
-v ${SOURCE}:/source/ \
-v ${OUTPUT}:/output/ \
--env BUILD_OPTS="-Dnoredist -DskipTests -Dsystemvm-kvm -Dsystemvm-xen -Dsystemvm-vmware" \
weizhouapache/cloudstack-builder:ubuntu2204.v1

An example how to build packages from git repository

SUDO=
SOURCE=https://github.com/apache/cloudstack.git
VERSION=4.19.0.0
OUTPUT=/tmp/
BUILD_OPTS="-Dnoredist -DskipTests -Dsystemvm-kvm -Dsystemvm-xen -Dsystemvm-vmware"
CONTAINER_NAME="cloudstack-builder-$(echo $RANDOM | tr '[0-9]' '[a-z]')"
$SUDO mkdir -p ~/.m2/
$SUDO mkdir -p ${OUTPUT}
$SUDO docker run -ti \
-n $CONTAINER_NAME \
-v ~/.m2:/root/.m2/ \
-v ${OUTPUT}:/output/ \
-e SOURCE \
-e OUTPUT \
-e BUILD_OPTS \
weizhouapache/cloudstack-builder:ubuntu2204.v1

Build Options

OSOptionNote
Ubuntu/Rocky-DnoredistSupport non-Open Source Software (e.g. VMware)
-DskipTestsSkip unit tests
-Dsystemvm-kvmBundle with SystemVM template for KVM
-Dsystemvm-vmwareBundle with SystemVM template for VMware
-Dsystemvm-xenBundle with SystemVM template for XenServer/XCP-ng
-T nBuilds with n threads

The default value is -Dnoredist -DskipTests -Dsystemvm-kvm -Dsystemvm-xen -Dsystemvm-vmware -T2

Package Options (RPM only)

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

OSOptionNote
Rocky 8-p, --packDefine which type of libraries to package ("oss"|"OSS"|"noredist"|"NOREDIST") (default "oss")
-T, --use-timestampUse epoch timestamp instead of SNAPSHOT in the package name (if not provided, use "SNAPSHOT")
-t, --templatesPasses necessary flag to package the required templates. Comma separated string - kvm,xen,vmware,ovm,hyperv

The default value is not set.

About

Docker Containers to build packages for Apache CloudStack.

Resources

Stars

3 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages