Mellanox / mofed_dockerfiles

MOFED Docker files
Apache License 2.0
8 stars 4 forks source link

Problem with building Centos image #1

Open asdfsx opened 5 years ago

asdfsx commented 5 years ago

I'm trying to build a image using follow dockerfile

FROM centos:centos7.5.1804
RUN yum install -y perl numactl-libs gtk2 atk cairo gcc-gfortran tcsh libnl3 tcl tk python-devel pciutils make lsof redhat-rpm-config rpm-build libxml2-python ethtool iproute net-tools openssh-clients git openssh-server wget libfabric traceroute iperf3

WORKDIR /tmp/

ENV MOFED_VER 4.4-2.0.7.0
ENV OS_VER rhel7.5
ENV PLATFORM x86_64

RUN wget http://content.mellanox.com/ofed/MLNX_OFED-${MOFED_VER}/MLNX_OFED_LINUX-${MOFED_VER}-${OS_VER}-${PLATFORM}.tgz && \
        tar -xvf MLNX_OFED_LINUX-${MOFED_VER}-${OS_VER}-${PLATFORM}.tgz && \
        MLNX_OFED_LINUX-${MOFED_VER}-${OS_VER}-${PLATFORM}/mlnxofedinstall --user-space-only --without-fw-update --all --force

ADD entrypoint.sh /usr/local/bin/entrypoint.sh

ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]

But got the error message:

Error: The current MLNX_OFED_LINUX is intended for rhel7.5

So I hack into the container to check the install script Then I found the script considered that the image is rhel7u5alternate but the value of dist_rpm is centos-release-7-5.1804.el7.centos.2

} elsif ($dist_rpm =~ /redhat-release-.*-7.5.*el7a|sl-release-7.5.*el7a|centos-release-7-5.*el7.centos.a*/) {
        print_and_log_colored($dist_rpm, 1, "YELLOW");
        print("1---", $dist_rpm =~ /centos-release-7-5.*el7.centos.a*/, "---\n");
        print("2---",$dist_rpm =~ /redhat-release-.*-7.5.*el7a|sl-release-7.5.*el7a|centos-release-7-5.*el7.centos.a*/,"---\n");
        print("3---",$dist_rpm =~ /redhat-release-.*-7.5.*el7a|sl-release-7.5.*el7a/,"---\n");
        $DISTRO = "RHEL7.5ALTERNATE";
        $rpm_distro = "rhel7u5alternate";
    }

So I think the problem is regex centos-release-7-5.*el7.centos.a*, so I changed it to (centos-release-7-5.*el7.centos.a(.*)), and all passed. Is this a bug?

asdfsx commented 5 years ago

@paravmellanox does anybody know about this ?