Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add centos dockerfile #8

Merged
merged 1 commit into from
Sep 11, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions Dockerfile.centos
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
FROM centos:7

LABEL maintainer="yee.yi@vesoft.com"

RUN yum update -y \
&& yum install -y centos-release-scl \
&& yum install -y devtoolset-8 \
&& yum install -y \
autoconf \
autoconf-archive \
automake \
file \
git \
java-1.8.0-openjdk \
libtool \
make \
maven \
ncurses-devel \
perl \
perl-WWW-Curl \
readline-devel \
rpm-build \
unzip \
vim \
wget \
xz-devel \
yixinglu marked this conversation as resolved.
Show resolved Hide resolved
&& yum clean all \
&& rm -rf /var/cache/yum

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please add some notes for each primary step?

RUN scl enable devtoolset-8 -- bash \
&& mkdir -p /home/nebula \
&& ln -snf /opt/rh/devtoolset-8/enable /etc/profile.d/devtoolset-8.sh
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about changing the target name to devtoolset-8-setup.sh or other meaningful names?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about enable-devtoolset-8.sh or devtoolset-8-enable.sh ?


ENV NEBULA_HOME /home/nebula

WORKDIR ${NEBULA_HOME}

COPY ./install-deps.sh ${NEBULA_HOME}/

RUN ${NEBULA_HOME}/install-deps.sh

# Build and Install thirdparty
RUN git clone --single-branch --branch master https://github.com/vesoft-inc/nebula-3rdparty.git ${NEBULA_HOME}/nebula-3rdparty \
&& cd ${NEBULA_HOME}/nebula-3rdparty \
&& . /etc/profile.d/devtoolset-8.sh \
&& cmake -DSKIP_JAVA_JAR=ON . \
&& make && make install \
&& cd ${NEBULA_HOME} \
&& rm -rf ${NEBULA_HOME}/*
65 changes: 65 additions & 0 deletions install-deps.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
#!/bin/sh

set -ex

INSTALL_PATH=/opt/rh/devtoolset-8/root/usr
NEBULA_HOME=/home/nebula
EXTRA_CXXFLAGS="-O2 -m64 -march=x86-64"
EXTRA_PIC_CXXFLAGS="${EXTRA_CXXFLAGS} -fPIC -DPIC"
EXTRA_LDFLAGS="-static-libgcc -static-libstdc++"

. /etc/profile.d/devtoolset-8.sh

# Install openssl-1.1.0h
wget -qO - https://www.openssl.org/source/old/1.1.0/openssl-1.1.0h.tar.gz | tar zxf - -C ${NEBULA_HOME}
cd ${NEBULA_HOME}/openssl-1.1.0h
./config --prefix=${INSTALL_PATH} --openssldir=${INSTALL_PATH}/ssl no-shared threads ${EXTRA_CXXFLAGS} ${EXTRA_LDFLAGS}
make && make install

# Install cmake-3.11.4
wget -qO - https://github.com/Kitware/CMake/releases/download/v3.11.4/cmake-3.11.4.tar.gz | tar zxf - -C ${NEBULA_HOME}
cd ${NEBULA_HOME}/cmake-3.11.4
CXXFLAGS=${EXTRA_PIC_CXXFLAGS} CFLAGS=$CXXFLAGS CPPFLAGS=$CXXFLAGS LDFLAGS="${EXTRA_LDFLAGS} -pthread" ./configure --prefix=${INSTALL_PATH}
make && make install

# Install bison-3.0.5
wget -qO - http://ftp.gnu.org/gnu/bison/bison-3.0.5.tar.gz | tar zxf - -C ${NEBULA_HOME}
cd ${NEBULA_HOME}/bison-3.0.5
CXXFLAGS=${EXTRA_PIC_CXXFLAGS} CFLAGS=$CXXFLAGS CPPFLAGS=$CXXFLAGS LDFLAGS=${EXTRA_LDFLAGS} ./configure --prefix=${INSTALL_PATH} --enable-shared=no --enable-static
make && make install

# Install flex-2.6.4
wget -qO - https://github.com/westes/flex/releases/download/v2.6.4/flex-2.6.4.tar.gz | tar zxf - -C ${NEBULA_HOME}
cd ${NEBULA_HOME}/flex-2.6.4
CXXFLAGS=${EXTRA_PIC_CXXFLAGS} CFLAGS=$CXXFLAGS CPPFLAGS=$CXXFLAGS LDFLAGS=${EXTRA_LDFLAGS} ./configure --prefix=${INSTALL_PATH} --enable-shared=no
make && make install

# Install boost-1.66
wget -qO - https://dl.bintray.com/boostorg/release/1.66.0/source/boost_1_66_0.tar.gz | tar zxf - -C ${NEBULA_HOME}
cd ${NEBULA_HOME}/boost_1_66_0
./bootstrap.sh --prefix=${INSTALL_PATH} --without-icu --without-libraries=python
./b2 cxxflags=${EXTRA_CXXFLAGS} link=static runtime-link=static install
./b2 --clean-all

# Install gperf-3.1
wget -qO - http://ftp.gnu.org/pub/gnu/gperf/gperf-3.1.tar.gz | tar zxf - -C ${NEBULA_HOME}
cd ${NEBULA_HOME}/gperf-3.1
CXXFLAGS=${EXTRA_PIC_CXXFLAGS} CFLAGS=$CXXFLAGS CPPFLAGS=$CXXFLAGS LDFLAGS=${EXTRA_LDFLAGS} ./configure --prefix=${INSTALL_PATH} --enable-shared=no
make && make install

# Install krb5-1.16.3
wget -qO - https://github.com/krb5/krb5/archive/krb5-1.16.3-final.tar.gz | tar zxf - -C ${NEBULA_HOME}
cd ${NEBULA_HOME}/krb5-krb5-1.16.3-final/src
autoreconf
CXXFLAGS=$EXTRA_PIC_CXXFLAGS CFLAGS=$CXXFLAGS CPPFLAGS=$CXXFLAGS LDFLAGS=${EXTRA_LDFLAGS} ./configure --prefix=${INSTALL_PATH} --enable-static --disable-shared --disable-rpath --disable-aesni --disable-thread-support
make all && make install

# Install libunwind-1.2.1
wget -qO - https://github.com/libunwind/libunwind/releases/download/v1.2.1/libunwind-1.2.1.tar.gz | tar zxf - -C ${NEBULA_HOME}
cd ${NEBULA_HOME}/libunwind-1.2.1
CXXFLAGS=${EXTRA_PIC_CXXFLAGS} CFLAGS=$CXXFLAGS CPPFLAGS=$CXXFLAGS LDFLAGS=${EXTRA_LDFLAGS} ./configure --prefix=${INSTALL_PATH} --enable-shared=no
make && make install

# Cleanup
cd ${NEBULA_HOME}
rm -rf *