【发布时间】:2018-07-19 11:12:53
【问题描述】:
我对闪亮应用的 docker 化有疑问。我有一个在 R 3.4.4 中开发的闪亮的小应用程序。我想码头化它。我已经这样写了我的dockerfile:
FROM r-base:3.4.4
MAINTAINER aurelien beliard (email@domain.com)
RUN apt update
RUN apt install -y libcairo2-dev\
liblapack-dev \
liblapack3 \
libopenblas-base \
libopenblas-dev \
libxml2-dev \
libssl1.0.2 \
libssl-dev \
libcurl4-openssl-dev \
libudunits2-dev
RUN R -e "install.packages('shiny',dependencies=TRUE, repos='cran.rstudio.com/')";
RUN apt install -y gdebi-core
RUN wget https://download3.rstudio.org/ubuntu-14.04/x86_64/shiny-server-1.5.7.907-amd64.deb
RUN gdebi -n shiny-server-1.5.7.907-amd64.deb
RUN apt update
RUN R -e "install.packages('ggplot2',dependencies=TRUE, repos='cran.rstudio.com/')";
RUN R -e "install.packages('shinydashboard',dependencies=TRUE, repos='cran.rstudio.com/')";
RUN R -e "source('https://bioconductor.org/biocLite.R');\
biocLite('Gviz')";
COPY ./sources/ /srv/shiny-server/wes-cnv
COPY ./data /srv/shiny-server/wes-cnv/data
EXPOSE 3838
CMD ["/usr/bin/shiny-server"]
我使用 docker build 并且 R 包似乎与 R3.5.1 一起安装,当我以交互模式运行容器并在 bash shell 中执行 R 时,R 版本为 3.5.1:
R version 3.5.1 (2018-07-02) -- "Feather Spray"
Copyright (C) 2018 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
当我调用 ggplot2 时:
library('ggplot2')
我有这个错误:
Error in library("ggplot2") : there is no package called ‘ggplot2’
ggplot2 似乎在安装过程中出现错误,说库安装在另一个 R 版本中:
Error : package ‘stringi’ was installed by an R version with different internals; it needs to be reinstalled for use with this R version
但是闪亮的服务器可以完美运行。
如果有人有解释或/和解决方案,将不胜感激
ps:请原谅我在这里的第一个问题,英语不是我的母语。
【问题讨论】:
-
是什么让您认为安装了 3.5.1 版?请将该信息添加到您的问题中。
ggplot2 seem to bug这是什么意思?你有任何错误信息吗?如果是这样,请将它们添加到问题中。