我在Docker上安装了rstudio服务器。当我想安装png包时,收到错误消息
`* installing *source* package ‘png’ ...
** package ‘png’ successfully unpacked and MD5 sums checked
** libs
gcc -std=gnu99 -I/usr/local/lib/R/include -DNDEBUG -I/usr/local/include
`libpng-config --cflags` -fpic -g -O2 -fstack-protector-strong -Wformat -
Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c read.c -o
read.o
/bin/bash: libpng-config: command not found
read.c:3:17: fatal error: png.h: No such file or directory
#include <png.h>
^
compilation terminated.
/usr/local/lib/R/etc/Makeconf:132: recipe for target 'read.o' failed
make: *** [read.o] Error 1
ERROR: compilation failed for package ‘png’
* removing ‘/usr/local/lib/R/site-library/png’
Warning in install.packages :
installation of package ‘png’ had non-zero exit status`
我想也许我应该安装一个名为libpng-devel的库,但是如何在docker下安装它?请告诉我吗?如果我是ubuntu或centos,我知道apt-get或yum,但是在docker下,我很困惑。
最佳答案
您需要标识Rstudio的运行容器(例如docker ps
),然后使用docker exec -it <container-id>
在该容器中启动bash shell。从 shell 程序,您可以安装所需的任何系统软件包。
资料来源:https://github.com/rocker-org/rocker/wiki/Using-the-RStudio-image#dependencies-external-to-the-r-system
关于docker - 在Docker的Rstudio上安装png软件包,但失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43102546/