-
env
build scriptFROM registry.access.redhat.com/ubi9
ARG LDB_TOOLCHAIN_VERSION=0.21
ARG PRODUCT_VERSION=3.0.3-rc04
ARG JAVA_VERSION=17
# install system requirements
RUN <<EOT
# https://adoptium.net/en-GB/installation/linux/#_centosrhelfedora_instructions
cat <<EOF > /etc/yum.repos.d/adoptium.repo
[Adoptium]
name=Adoptium
baseurl=https://packages.adoptium.net/artifactory/rpm/${DISTRIBUTION_NAME:-$(. /etc/os-release; echo $ID)}/\$releasever/\$basearch
enabled=1
gpgcheck=1
gpgkey=https://packages.adoptium.net/artifactory/api/gpg/key/public
EOF
dnf update -y
dnf install -y \
automake \
bzip2 \
cmake \
cyrus-sasl-devel \
diffutils \
fuse-devel \
gcc \
gcc-c++ \
gettext \
git \
gzip \
hostname \
krb5-devel \
libcurl-devel \
libtool \
make \
maven \
nodejs \
openssl-devel \
patch \
pkg-config \
perl-CPAN \
tar \
temurin-17-jdk \
tzdata-java \
unzip \
wget \
which \
xz \
zlib-devel \
zip
microdnf clean all
rm -rf /var/cache/yum
# smoke test
java -version
EOT
ENV JAVA_HOME=/usr/lib/jvm/temurin-${JAVA_VERSION}-jdk
ENV JAVA_VERSION=${JAVA_VERSION}
# setup gettext
# Because of the gettext of dnf is lack autopoint, so we need to install gettext from source.
# Download gettext https://ftp.gnu.org/gnu/gettext/gettext-0.21.tar.gz
RUN <<EOF
set -ex
# Get already installed gettext version
GETTEXT_VERSION=$(gettext --version | head -n 1 | awk '{print $4}')
mkdir -p /build/gettext
mkdir -p /opt/gettext
pushd /build/gettext
curl -sSLf https://ftp.gnu.org/gnu/gettext/gettext-${GETTEXT_VERSION}.tar.gz \
| tar -xz --strip-components=1
./configure --prefix=/opt/gettext
make -j$(nproc)
make install
popd
# cleanup
rm -rf /build/gettext
EOF
ENV PATH="/opt/gettext/bin:$PATH"
# setup ldb-toolchain
# Download ldb_toolchain_gen.aarch64.sh
# https://github.com/amosbird/ldb_toolchain_gen/releases/download/v0.9.1/ldb_toolchain_gen.aarch64.sh
# or https://github.com/amosbird/ldb_toolchain_gen/releases/download/v0.9.1/ldb_toolchain_gen.sh
# Note:
# - In 0.9.1, ldb-toolchain containes curl, it conflicts with the system curl,
# when use it, it will cause dns resolution error
# - In 0.21, ldb-toolchain containes curl, it will verify the certificate
# file /etc/ssl/certs/ca-certificates.crt. But ca-certificates package generate a default
# file /etc/ssl/certs/ca-bundle.crt, so we need to create a symlink to fix it.
# - 0.14.1 aaarch64 version is error to build doris
RUN <<EOF
set -ex
ARCH=$(uname -m)
ARCH=${ARCH/arm64/aarch64}
release_file="ldb_toolchain_gen.sh"
if [ "$ARCH" == "aarch64" ]; then
release_file="ldb_toolchain_gen.aarch64.sh"
fi
mkdir -p /build/ldb-toolchain
pushd /build/ldb-toolchain
curl -sSLf https://github.com/amosbird/ldb_toolchain_gen/releases/download/v${LDB_TOOLCHAIN_VERSION}/${release_file} \
-o ldb_toolchain_gen.sh
chmod +x ldb_toolchain_gen.sh
./ldb_toolchain_gen.sh /opt/ldb-toolchain
popd
# create a symlink to bison, because doris need byacc
ln -s /opt/ldb-toolchain/bin/bison /opt/ldb-toolchain/bin/byacc
# fix /opt/ldb-toolchain/bin/curl certificate verify failed
ln -s /etc/ssl/certs/ca-bundle.crt /etc/ssl/certs/ca-certificates.crt
# cleanup
rm -rf /build/ldb-toolchain
EOF
ENV PATH="/opt/ldb-toolchain/bin:$PATH"
# build doris
# Download doris https://github.com/apache/doris/archive/refs/tags/3.0.3-rc04.tar.gz
RUN <<EOF
set -ex
# alias python3 to python
ln -s /usr/bin/python3 /usr/bin/python
mkdir -p /build/doris
pushd /build/doris
curl -sSLf https://github.com/apache/doris/archive/refs/tags/${PRODUCT_VERSION}.tar.gz \
| tar -xz --strip-components=1
# Add `set -x` after `set -euo pipefail`
sed -i '/set -eo pipefail/a set -x' /build/doris/build.sh
sed -i '/set -eo pipefail/a set -x' /build/doris/thirdparty/build-thirdparty.sh
# build doris, disable avx2
export USE_AVX2=OFF
export USE_UNWIND=OFF
# ./build.sh
nohup ./build.sh > /build/doris-build.log 2>&1 &
tail -f /build/doris-build.log
# TODO
EOF
error with linux/arm64
|
Beta Was this translation helpful? Give feedback.
Answered by
zclllyybb
Jan 7, 2025
Replies: 1 comment
-
azure-sdk is not supported in arm |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
whg517
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
azure-sdk is not supported in arm