|
# |
|
# YugabyteDB build steps from: |
|
# https://docs.yugabyte.com/latest/contribute/core-database/build-from-src-centos/ |
|
# |
|
FROM centos:7.9.2009 |
|
|
|
ARG GCC_VERSION=7.3.0 |
|
ARG YB_VERSION=2.7.1.1 |
|
ARG MAKE_GCC_PARALLELISM=16 |
|
|
|
COPY docker-entrypoint.sh /docker-entrypoint.sh |
|
|
|
RUN echo 'YugabyteDB build tooling' \ |
|
&& yum -y update \ |
|
&& yum -y groupinstall 'Development Tools' \ |
|
&& yum install -y ruby perl-Digest epel-release ccache git python2-pip python-devel python3 python3-pip python3-devel which \ |
|
&& yum install -y cmake3 ctest3 ninja-build \ |
|
&& yum install -y git \ |
|
&& yum install -y java-1.8.0-openjdk java-1.8.0-openjdk-devel maven \ |
|
&& ln -s /usr/bin/cmake3 /usr/local/bin/cmake \ |
|
&& ln -s /usr/bin/ctest3 /usr/local/bin/ctest \ |
|
&& echo 'Updated GCC for building extensions later on' \ |
|
&& yum install -y wget bzip2 \ |
|
&& cd /tmp \ |
|
&& wget http://ftp.mirrorservice.org/sites/sourceware.org/pub/gcc/releases/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.gz \ |
|
&& tar zxf gcc-${GCC_VERSION}.tar.gz \ |
|
&& cd gcc-${GCC_VERSION} \ |
|
&& ./contrib/download_prerequisites \ |
|
&& ./configure --disable-multilib --enable-languages=c,c++ \ |
|
&& make -j ${MAKE_GCC_PARALLELISM} \ |
|
&& make install \ |
|
&& echo 'Get YugabyteDB sources' \ |
|
&& mkdir -p /yb-source \ |
|
&& cd /yb-source \ |
|
&& git clone https://github.com/yugabyte/yugabyte-db.git . \ |
|
&& git checkout v${YB_VERSION} \ |
|
&& mkdir -m 777 /opt/yb-build \ |
|
&& echo 'Make the release' \ |
|
&& cd /yb-source \ |
|
&& ./yb_build.sh release \ |
|
&& yes | ./yb_release \ |
|
&& mv /yb-source/build/yugabyte-${YB_VERSION}-*.tar.gz /yugabyte-${YB_VERSION}-linux.tar.gz \ |
|
&& mkdir -p /yb \ |
|
&& echo 'Decompress the release so pg_config becomes available' \ |
|
&& tar xvfz /yugabyte-${YB_VERSION}-linux.tar.gz -C /yb --strip 1 \ |
|
&& echo 'Cleanup' \ |
|
&& yum clean all -y \ |
|
&& rm -rf $HOME/.m2 \ |
|
&& rm -rf /tmp/gcc-${GCC_VERSION} \ |
|
&& echo 'Final image setup' \ |
|
&& chmod +x /docker-entrypoint.sh |
|
|
|
VOLUME /yb-source/build/release-gcc-dynamic-ninja/extension |
|
|
|
ENTRYPOINT [ "/docker-entrypoint.sh" ] |