Dockerfile没有安装ggmap

时间:2017-12-15 21:11:35

标签: r git docker dockerfile

当我试图通过docker容器运行项目时,我遇到了错误。图像失败并说没有安装ggmap,尽管它在Dockerfile中被调用。

这是指向我的存储库的链接:https://github.com/TedHaley/tree_value.git

这就是我的dockerfile的样子:

FROM rocker/tidyverse
RUN Rscript -e "install.packages('devtools')"
RUN Rscript -e "install.packages('ezknitr')"
RUN Rscript -e "install.packages('lubridate')"
RUN Rscript -e "install.packages('dplyr')"
RUN Rscript -e "install.packages('readr')"
RUN Rscript -e "install.packages('ggplot2')"
RUN Rscript -e "install.packages('rgdal')"
RUN Rscript -e "install.packages('broom')"
RUN Rscript -e "install.packages('maptools')"
RUN Rscript -e "install.packages('gpclib')"
RUN Rscript -e "install.packages('packrat')"
RUN Rscript -e "install.packages('MASS')"
RUN Rscript -e "install.packages('scales')"
RUN Rscript -e "install.packages('stringr')"
RUN Rscript -e "install.packages('hexbin')"
RUN Rscript -e "install.packages('reshape2')"

RUN Rscript -e "install.packages('ggmap', repos = 'http://cran.us.r-project.org')"

如果有人对ggmap未正确安装的原因有任何想法,那将是一个巨大的帮助。

1 个答案:

答案 0 :(得分:1)

您的图片基于rocker/tidyverse,基于rocker/rstudio,基于rocker/-base
他们都没有安装ggmap。

请参阅achubaty/r-spatial-devel,其中包含

## install R spatial packages && cleanup 
RUN xvfb-run -a install.r \ 
                geoR \ 
                ggmap \

尝试从可以测试ggmap存在的图片开始。