在 docker 容器 gcc-toolset-11 中创建 rpm 时出现问题 - libelf.so.dts.1

Problem creating rpm in docker container gcc-toolset-11 - libelf.so.dts.1

我有一台带有 Oracle Linux 8 docker 容器和 gcc-toolset-11 的 CentOS 7 机器。当我尝试在容器中构建项目时,出现以下错误:

extracting debug info from /cm/build/rpmbuild/BUILDROOT/MyPackage-9.1.0-497.ol8.x86_64/usr/local/bin/mariadb
gdb-add-index: No index was created for /cm//build/rpmbuild/BUILDROOT/MyPackage-9.1.0-497.ol8.x86_64/usr/local/bin/mariadb
gdb-add-index: [Was there no debuginfo? Was there already an index?]
gdb-add-index: No index was created for /cm/build/rpmbuild/BUILDROOT/MyPackage-9.1.0-497.ol8.x86_64/usr/local/bin/mariadb-binlog
gdb-add-index: [Was there no debuginfo? Was there already an index?]
eu-strip: error while loading shared libraries: libelf.so.dts.1: cannot open shared object file: No such file or directory
eu-strip: error while loading shared libraries: libelf.so.dts.1: cannot open shared object file: No such file or directory
eu-strip: error while loading shared libraries: libelf.so.dts.1: cannot open shared object file: No such file or directory
eu-strip: error while loading shared libraries: libelf.so.dts.1: cannot open shared object file: No such file or directory
/usr/lib/rpm/find-debuginfo.sh: line 501: /tmp/find-debuginfo.NCirqm/res.*: No such file or directory
error: Bad exit status from /var/tmp/rpm-tmp.tHJ5xo (%install)

有什么帮助吗?

我明白了。我无法让 source /opt/rh/gcc-toolset-11/enable 工作,所以我将所有路径作为 ENV 命令放在 Docerfile 中。但我显然做错了。修复了错误的 ENV 命令,现在可以正确构建。