From 73c5dfbf79e7b4c3e5099ec7767f178e8489c3e3 Mon Sep 17 00:00:00 2001 From: "clinton.begin" Date: Fri, 11 Aug 2017 14:51:19 -0600 Subject: [PATCH 1/5] buildfile --- Dockerfile.build | 24 ++++++++++++++++++++++++ MariaDB.repo | 5 +++++ 2 files changed, 29 insertions(+) create mode 100644 Dockerfile.build create mode 100644 MariaDB.repo diff --git a/Dockerfile.build b/Dockerfile.build new file mode 100644 index 00000000000..114ade2fff6 --- /dev/null +++ b/Dockerfile.build @@ -0,0 +1,24 @@ +FROM centos:7 + +COPY MariaDB.repo /etc/yum.repos.d/MariaDB.repo + +RUN yum update -y + +RUN yum install -y lsb + +RUN yum install -y gcc gcc-c++ ncurses-devel bison flex glibc-devel cmake libgcc perl make libtool \ + openssl-devel libaio libaio-devel librabbitmq-devel libcurl-devel pcre-devel rpm-build libedit-devel \ + git xz-devel + +RUN yum install -y mariadb-server +RUN yum install -y mariadb-devel + +RUN git clone https://github.com/cbegin/GPLScale.git + +RUN mkdir -p /GPLScale/build + +WORKDIR /GPLScale/build + + + + diff --git a/MariaDB.repo b/MariaDB.repo new file mode 100644 index 00000000000..a82cfea4d7a --- /dev/null +++ b/MariaDB.repo @@ -0,0 +1,5 @@ +[mariadb] +name = MariaDB +baseurl = http://yum.mariadb.org/10.1/centos7-amd64 +gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB +gpgcheck=1 \ No newline at end of file From 004784f0f41ba7e9823494478c85b9c73bd7907e Mon Sep 17 00:00:00 2001 From: clinton Date: Sun, 13 Aug 2017 10:56:48 -0600 Subject: [PATCH 2/5] builds and tests pass, rpm generated --- Dockerfile.build | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/Dockerfile.build b/Dockerfile.build index 114ade2fff6..df939d6f260 100644 --- a/Dockerfile.build +++ b/Dockerfile.build @@ -2,23 +2,32 @@ FROM centos:7 COPY MariaDB.repo /etc/yum.repos.d/MariaDB.repo +# Install Prerequisites +RUN yum install -y epel-release RUN yum update -y - RUN yum install -y lsb - RUN yum install -y gcc gcc-c++ ncurses-devel bison flex glibc-devel cmake libgcc perl make libtool \ openssl-devel libaio libaio-devel librabbitmq-devel libcurl-devel pcre-devel rpm-build libedit-devel \ git xz-devel - RUN yum install -y mariadb-server RUN yum install -y mariadb-devel - RUN git clone https://github.com/cbegin/GPLScale.git -RUN mkdir -p /GPLScale/build +# Install P +RUN mkdir -p /GPLScale/pcre2/build +WORKDIR /GPLScale/pcre2/build +RUN cmake .. -DCMAKE_C_FLAGS=-fPIC -DBUILD_SHARED_LIBS=N -DPCRE2_BUILD_PCRE2GREP=N -DPCRE2_BUILD_TESTS=N && echo $? +RUN make && echo $? +RUN make install && echo $? +RUN mkdir -p /GPLScale/build WORKDIR /GPLScale/build +RUN cmake .. -DPACKAGE=Y && echo $? +RUN make && echo $? +RUN make install && echo $? +RUN make testcore +RUN make package - +VOLUME /rpm From b5a6e77e882bc280b50bc38b257c57c19e61eaa1 Mon Sep 17 00:00:00 2001 From: "clinton.begin" Date: Sun, 20 Aug 2017 21:22:54 -0600 Subject: [PATCH 3/5] added docker based build with makefile --- .gitignore | 1 - Dockerfile.build | 10 ++++++++++ Makefile | 11 +++++++++++ 3 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 Makefile diff --git a/.gitignore b/.gitignore index fb556eab230..4488b0930f1 100644 --- a/.gitignore +++ b/.gitignore @@ -50,4 +50,3 @@ CMakeFiles/* */*/*/CMakeFiles/* */*/*/*/CMakeFiles/* *.cmake -Makefile diff --git a/Dockerfile.build b/Dockerfile.build index 114ade2fff6..2aed8145e09 100644 --- a/Dockerfile.build +++ b/Dockerfile.build @@ -19,6 +19,16 @@ RUN mkdir -p /GPLScale/build WORKDIR /GPLScale/build +RUN cmake -DPACKAGE=Y .. +RUN make +RUN make testcore +RUN make package + +RUN mkdir /packages && \ + mv maxscale*.rpm /packages && \ + mv maxscale*.tar.gz /packages + +VOLUME /dist diff --git a/Makefile b/Makefile new file mode 100644 index 00000000000..5dbc49b242a --- /dev/null +++ b/Makefile @@ -0,0 +1,11 @@ + +all: build dist + +build: + docker build -f Dockerfile.build . + +dist: + mkdir -p ./build + docker run -v ${shell realpath ./build}:/build -ti 16d0 bash -c "cp /packages/* /build" + +.PHONY: all build dist \ No newline at end of file From 7365c62543d54e3c25331bb37a5fcf2c8ebb200a Mon Sep 17 00:00:00 2001 From: "clinton.begin" Date: Sun, 20 Aug 2017 21:48:26 -0600 Subject: [PATCH 4/5] fixed build after merge --- Dockerfile.build | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/Dockerfile.build b/Dockerfile.build index e391f270c56..14018e3fb24 100644 --- a/Dockerfile.build +++ b/Dockerfile.build @@ -13,29 +13,26 @@ RUN yum install -y mariadb-server RUN yum install -y mariadb-devel RUN git clone https://github.com/cbegin/GPLScale.git -# Install P +# Install PCRE2 RUN mkdir -p /GPLScale/pcre2/build WORKDIR /GPLScale/pcre2/build -RUN cmake .. -DCMAKE_C_FLAGS=-fPIC -DBUILD_SHARED_LIBS=N -DPCRE2_BUILD_PCRE2GREP=N -DPCRE2_BUILD_TESTS=N && echo $? -RUN make && echo $? -RUN make install && echo $? +RUN cmake .. -DCMAKE_C_FLAGS=-fPIC -DBUILD_SHARED_LIBS=N -DPCRE2_BUILD_PCRE2GREP=N -DPCRE2_BUILD_TESTS=N +RUN make +RUN make install +# Install MaxScale RUN mkdir -p /GPLScale/build WORKDIR /GPLScale/build -RUN cmake .. -DPACKAGE=Y && echo $? -RUN make && echo $? -RUN make install && echo $? - -RUN cmake -DPACKAGE=Y .. - +RUN cmake .. -DPACKAGE=Y RUN make +RUN make install +# Test MaxScale RUN make testcore +# Package MaxScale RUN make package - RUN mkdir /packages && \ mv maxscale*.rpm /packages && \ mv maxscale*.tar.gz /packages -VOLUME /dist From 1a3314b3a124c8155f1b93631dc9c24e08e1e5f0 Mon Sep 17 00:00:00 2001 From: "clinton.begin" Date: Mon, 21 Aug 2017 13:17:12 -0600 Subject: [PATCH 5/5] captured config file for dist --- Makefile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 5dbc49b242a..cf8c6f00c1c 100644 --- a/Makefile +++ b/Makefile @@ -2,10 +2,14 @@ all: build dist build: - docker build -f Dockerfile.build . + docker build -t gplscale -f Dockerfile.build . dist: mkdir -p ./build - docker run -v ${shell realpath ./build}:/build -ti 16d0 bash -c "cp /packages/* /build" + docker run -v ${shell realpath ./build}:/build gplscale bash -c "cp /packages/* /build" + docker run -v ${shell realpath ./build}:/build gplscale bash -c "cp /etc/maxscale.cnf.template /build" + +run: + docker run -ti gplscale bash .PHONY: all build dist \ No newline at end of file