Skip to content

Commit 39a729f

Browse files
committed
Add centos7.v1
1 parent 69840ca commit 39a729f

File tree

4 files changed

+90
-3
lines changed

4 files changed

+90
-3
lines changed

centos7.v1/Dockerfile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
FROM centos:centos7
2+
MAINTAINER Wei Zhou <weizhou@apache.org>
3+
4+
RUN yum install -y which mlocate java-11-openjdk java-11-openjdk-devel maven rpm-build \
5+
&& yum install -y ws-commons-util gcc glibc-devel mkisofs python-setuptools python3 python3-pip python3-setuptools wget curl git \
6+
&& update-alternatives --set java java-11-openjdk.x86_64 \
7+
&& update-alternatives --set javac java-11-openjdk.x86_64 \
8+
&& wget https://cdn.mysql.com/archives/mysql-connector-python-2.1/mysql-connector-python-2.1.7-1.el7.x86_64.rpm \
9+
&& rpm -ivh mysql-connector-python-2.1.7-1.el7.x86_64.rpm
10+
11+
RUN curl -sL https://rpm.nodesource.com/setup_14.x | bash - \
12+
&& yum install -y nodejs
13+
14+
COPY entrypoint.sh /entrypoint.sh
15+
16+
ENTRYPOINT ["/entrypoint.sh"]

centos7.v1/entrypoint.sh

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

config.centos7.sample

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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=centos7.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+
# The options for `package.sh` (RPM only)
25+
# Please refer to https://github.com/apache/cloudstack/blob/main/packaging/package.sh
26+
PACKAGE_OPTS=
27+
28+
# Please set to sudo if use a non-root user
29+
SUDO=

rocky8.v1/Dockerfile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,14 @@ FROM rockylinux:8
22
MAINTAINER Wei Zhou <weizhou@apache.org>
33

44
RUN yum install -y which mlocate java-11-openjdk java-11-openjdk-devel maven rpm-build \
5-
&& yum install -y gcc glibc-devel mkisofs python2 python3 python3-pip python3-setuptools wget curl \
5+
&& yum install -y gcc glibc-devel mkisofs python2 python3 python3-pip python3-setuptools wget curl git \
66
&& alternatives --set java java-11-openjdk.x86_64 \
77
&& alternatives --set javac java-11-openjdk.x86_64 \
88
&& alternatives --set python /usr/bin/python3
99

1010
RUN curl -sL https://rpm.nodesource.com/setup_14.x | bash - \
1111
&& yum install -y nodejs
1212

13-
RUN yum install -y git
14-
1513
COPY entrypoint.sh /entrypoint.sh
1614

1715
ENTRYPOINT ["/entrypoint.sh"]

0 commit comments

Comments
 (0)