【发布时间】:2022-09-30 21:51:14
【问题描述】:
尝试在 centos7 上安装 redux r 包时出错,不知道如何修复它。以前有人遇到过吗?
我的 Dockerfile 是:
FROM centos:centos7
RUN yum -y install wget git tar
RUN yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
RUN yum -y install epel-release openssh-server
ENV R_VERSION=4.0.5
RUN wget https://cdn.rstudio.com/r/centos-7/pkgs/R-${R_VERSION}-1-1.x86_64.rpm \\
&& yum -y install R-${R_VERSION}-1-1.x86_64.rpm \\
&& rm R-${R_VERSION}-1-1.x86_64.rpm
ENV PATH=\"${PATH}:/opt/R/${R_VERSION}/bin/\"
RUN yum -y install openssl-devel
RUN Rscript -e \"install.packages(c(\'redux\'), repos = \'https://packagemanager.rstudio.com/all/__linux__/centos7/latest\')\"
RUN Rscript -e \"library(redux)\"
CMD [\"/bin/bash\"]
然后我构建图像:
docker build -t test-3:latest .
我得到的错误是:
=> ERROR [8/8] RUN Rscript -e \"library(redux)\" 0.6s
------
> [8/8] RUN Rscript -e \"library(redux)\":
#12 0.528 Error: package or namespace load failed for \'redux\' in dyn.load(file, DLLpath = DLLpath, ...):
#12 0.528 unable to load shared object \'/opt/R/4.0.5/lib/R/library/redux/libs/redux.so\':
#12 0.528 libhiredis.so.0.12: cannot open shared object file: No such file or directory
#12 0.528 Execution halted
------
executor failed running [/bin/sh -c Rscript -e \"library(redux)\"]: exit code: 1
附言。我能够安装任何其他软件包并毫无问题地引用它
-
顺便说一句,为了优化你的 Docker 镜像,我建议将一堆 yum install 行合并到一个 RUN 命令中。每个 RUN 命令都会创建一个新层,这在这里有点毫无意义。