HDDS-11143. Switch to Rocky Linux 8 as CentOS 7 is EOL (#23)
diff --git a/Dockerfile b/Dockerfile
index b7ea33c..004a046 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -32,20 +32,25 @@
exit 1 ; \
fi
-FROM centos:7.9.2009 AS builder
+FROM rockylinux:8.9 AS builder
# Required for cmake3 and gcc 10
-RUN yum -y install epel-release centos-release-scl
+RUN dnf install -y epel-release
RUN set -eux ; \
- yum -y install \
+ dnf -y install \
cmake3 \
- devtoolset-10-gcc-c++ \
+ gcc-toolset-10 \
make \
perl \
which \
- && yum clean all
-RUN ln -s /usr/bin/cmake3 /usr/bin/cmake
+ && dnf clean all
+RUN [ -e /usr/bin/cmake ] || ln -s /usr/bin/cmake3 /usr/bin/cmake
# Add gcc 10 bin path
-ENV PATH=/opt/rh/devtoolset-10/root/usr/bin:$PATH
+# Set environment variables for the C and C++ compilers
+ENV CMAKE_COMMAND cmake3
+ENV CXX /opt/rh/gcc-toolset-10/root/usr/bin/g++
+ENV CC /opt/rh/gcc-toolset-10/root/usr/bin/gcc
+
+# Now proceed with other build steps...
RUN export GFLAGS_VER=2.2.2 \
&& curl -LSs https://github.com/gflags/gflags/archive/v${GFLAGS_VER}.tar.gz | tar zxv \
&& cd gflags-${GFLAGS_VER} \
@@ -56,6 +61,7 @@
&& make install \
&& cd ../.. \
&& rm -r gflags-${GFLAGS_VER}
+
RUN export ZSTD_VER=1.5.2 \
&& curl -LSs https://github.com/facebook/zstd/archive/v${ZSTD_VER}.tar.gz | tar zxv \
&& cd zstd-${ZSTD_VER} \
@@ -63,6 +69,7 @@
&& make install \
&& cd .. \
&& rm -r zstd-${ZSTD_VER}
+
RUN export ROCKSDB_VER=7.7.3 \
&& curl -LSs https://github.com/facebook/rocksdb/archive/v${ROCKSDB_VER}.tar.gz | tar zxv \
&& mv rocksdb-${ROCKSDB_VER} rocksdb \
@@ -72,12 +79,13 @@
&& cd .. \
&& rm -r rocksdb
-FROM centos:7.9.2009
+FROM rockylinux:8.9
RUN rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
RUN set -eux ; \
- yum install -y \
+ dnf install -y \
bzip2 \
diffutils \
+ findutils \
fuse \
jq \
krb5-workstation \
@@ -89,7 +97,8 @@
snappy \
sudo \
zlib \
- && yum clean all
+ && dnf clean all \
+ && ln -sf /usr/bin/python3 /usr/bin/python
RUN sudo python3 -m pip install --upgrade pip
COPY --from=go /go/bin/csc /usr/bin/csc
@@ -155,6 +164,9 @@
rm -f openjdk.tar.gz
ENV JAVA_HOME=/usr/local/jdk-17.0.2
+# compatibility with Ozone 1.4.0 and earlier compose env.
+RUN mkdir -p /usr/lib/jvm && ln -s $JAVA_HOME /usr/lib/jvm/jre
+
ENV LD_LIBRARY_PATH=/usr/local/lib
ENV PATH=/opt/hadoop/libexec:$PATH:$JAVA_HOME/bin:/opt/hadoop/bin