是否可以提供基于openssl1.1.1版本的编译二进制包,或者提供一个centos7中使用openssl1.1.1的编译方案也可以。我现在使用下面的方案进行编译没有通过。
- FROM centos:7
- ENV LANG en_US.utf8
- RUN yum install -y epel-release && \
- curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.cloud.tencent.com/repo/centos7_base.repo && \
- yum clean all && \
- yum makecache
- RUN yum install -y yum-utils && \
- RUN yum install -y --skip-broken yum-utils wget diffutils net-tools vim git gcc gcc-c++ automake libtool cmake cmake3 \
- make psmisc zlib-devel readline-devel bzip2-devel expat-devel \
- bison flex wget unzip libcurl-devel libevent-devel libffi-devel lz4-devel \
- file clang bzip2 libxml2-devel libtirpc libtirpc-devel numactl-devel numactl-libs \
- numactl openldap-devel openldap-clients pam-devel valgrind boost-devel \
- libzstd libzstd-devel patchelf perl perl-Env perl-JSON perl-Memoize perl-Time-HiRes time libaio-devel libarchive \
- ncurses-devel ncurses-libs pam redhat-lsb-core scl-utils-build pkg-config ccache \
- jemalloc jemalloc-devel libicu-devel re2-devel redhat-lsb-core rpm* tar libssh \
- cyrus-sasl-devel cyrus-sasl-scram
- #RUN dnf install -y dnf
- RUN dnf install -y gcc-toolset-11 gcc-toolset-11-annobin-plugin-gcc && source /opt/rh/gcc-toolset-11/enable
- RUN echo 'source /opt/rh/gcc-toolset-11/enable' >> /root/.bash_profile
- #git, https://github.com/git/git/archive/v2.27.0.tar.gz, 下载后重命名为 git-v2.27.0.tar.gz
- COPY git-v2.27.0.tar.gz /tmp/
- RUN cd /tmp/ && tar -xzvf git-v2.27.0.tar.gz && cd git-2.27.0 && make prefix=/opt/git/ all && make prefix=/opt/git/ install
- RUN mv /usr/bin/git /usr/bin/git.bk && ln -s /opt/git/bin/git /usr/bin/git
- #patchelf, https://github.com/NixOS/patchelf/archive/refs/tags/0.12.tar.gz, 下载后重命名为 patchelf-0.12.tar.gz
- #如果编译过程报错,再手动打补丁 https://github.com/NixOS/patchelf/pull/275/files
- COPY patchelf-0.12.tar.gz /tmp/
- RUN cd /tmp && tar -xzvf patchelf-0.12.tar.gz && cd patchelf-0.12 && ./bootstrap.sh && ./configure && make && make install
- #rpcsvc-proto, https://github.com/thkukuk/rpcsvc-proto/releases/download/v1.4/rpcsvc-proto-1.4.tar.gz
- COPY rpcsvc-proto-1.4.tar.gz /tmp/rpcsvc-proto-1.4.tar.gz
- RUN tar zxvf /tmp/rpcsvc-proto-1.4.tar.gz -C /tmp && cd /tmp/rpcsvc-proto-1.4/ && ./configure && make && make install
- RUN rm -fr /tmp/*
- COPY openssl-1.1.1v.tar.gz /tmp/openssl-1.1.1v.tar.gz
- RUN tar zxvf /tmp/openssl-1.1.1v.tar.gz -C /tmp && cd /tmp/openssl-1.1.1v/ && ./config --prefix=/usr/local/openssl -d shared -fPIC && make -j 4 && make install &&echo '/usr/local/openssl/lib' >> /etc/ld.so.conf &&ldconfig -v
- RUN rm -fr /tmp/*
- #boost, https://boostorg.jfrog.io/artifactory/main/release/1.73.0/source/boost_1_73_0.tar.gz
- COPY boost_1_73_0.tar.gz /opt/
- RUN ln -fs /usr/bin/cmake3 /usr/bin/cmake
复制代码
- #!/bin/bash
- MAJOR_VERSION=8
- MINOR_VERSION=0
- PATCH_VERSION=32
- RELEASE=24
- REVISION=3714067bc8c
- GLIBC=`ldd --version | head -n 1 | awk '{print $NF}'`
- ARCH=`uname -p`
- OS=`grep '^ID=' /etc/os-release | sed 's/.*"\(.*\)".*/\1/ig'`
- #OS=Linux
- PKG_NAME=GreatSQL-${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}-${RELEASE}-${OS}-glibc${GLIBC}-${ARCH}
- BASE_DIR=/usr/local/mysql
- BOOST_VERSION=1_77_0
- SOURCE_DIR=greatsql-${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}-${RELEASE}
- CMAKE_EXE_LINKER_FLAGS=""
- JOBS=`lscpu | grep '^CPU(s)'|awk '{print $NF}'`
- if [ ${JOBS} -ge 16 ] ; then
- JOBS=`expr ${JOBS} - 4`
- else
- JOBS=`expr ${JOBS} - 1`
- fi
- if [ ${ARCH} = "x86_64" ] ; then
- CMAKE_EXE_LINKER_FLAGS=" -ljemalloc "
- fi
- if [ ${ARCH} = "loongarch64" ] ; then
- cd /opt/${SOURCE_DIR}
- sed -i 's/\(.*defined.*mips.*\) \\/\1 defined(__loongarch__) || \\/ig' extra/icu/source/i18n/double-conversion-utils.h
- fi
- cd /opt/${SOURCE_DIR} && \
- rm -fr bld && \
- mkdir bld && \
- cd bld && \
- cmake .. -DBOOST_INCLUDE_DIR=/opt/boost_${BOOST_VERSION} \
- -DLOCAL_BOOST_DIR=/opt/boost_${BOOST_VERSION} \
- -DCMAKE_INSTALL_PREFIX=${BASE_DIR} -DWITH_ZLIB=bundled \
- -DWITH_NUMA=ON -DCMAKE_EXE_LINKER_FLAGS="${CMAKE_EXE_LINKER_FLAGS}" \
- -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_CONFIG=mysql_release \
- -DOPENSSL_ROOT_DIR=/usr/local/openssl -DOPENSSL_LIBRARIES=/usr/local/openssl/lib -DOPENSSL_CRYPTO_LIBRARY=/usr/local/openssl/lib -DOPENSSL_INCLUDE_DIR=/usr/local/openssl/include \
- -DWITH_SSL=/usr/local/openssl \
- -DWITH_LIBEVENT=bundled \
- -DWITH_TOKUDB=OFF -DWITH_ROCKSDB=OFF \
- -DCOMPILATION_COMMENT="${MYSQL} GreatSQL, Release ${RELEASE}, Revision ${REVISION}" \
- -DMAJOR_VERSION=${MAJOR_VERSION} -DMINOR_VERSION=${MINOR_VERSION} -DPATCH_VERSION=${PATCH_VERSION} \
- -DWITH_NDB=OFF -DWITH_NDBCLUSTER_STORAGE_ENGINE=OFF -DWITH_NDBCLUSTER=OFF \
- -DWITH_UNIT_TESTS=OFF -DWITH_SYSTEMD=ON \
- >> /tmp/greatsql-automake.log 2>&1 && make -j${JOBS} >> /tmp/greatsql-automake.log 2>&1 && make -j${JOBS} install >> /tmp/greatsql-automake.log 2>&1
复制代码
|