I create a Dockerfile:
# Base image https://hub.docker.com/u/rocker/
FROM rocker/shiny:latest
# system libraries of general use
## install debian packages
RUN apt-get update -qq && apt-get -y --no-install-recommends install \
libxml2-dev \
libcairo2-dev \
libsqlite3-dev \
libmariadbd-dev \
libpq-dev \
libssh2-1-dev \
unixodbc-dev \
libcurl4-openssl-dev \
libssl-dev \
libproj-dev \
gdal-bin
## update system libraries
RUN apt-get update && \
apt-get upgrade -y && \
apt-get clean
RUN install2.r --error \
methods \
jsonlite \
tseries
RUN R -e "install.packages(pkgs=c('shiny','leaflet','leaflet.providers','ggplot2','dplyr','shinythemes','ggspatial','googleCloudStorageR','sf','lubridate','googleAuthR','blastula','shinymanager','tiff','raster','scales','sp','RColorBrewer','anytime','rmarkdown','knitr','zip','evaluate','highr','methods','markdown','stringr','yaml','xfun','formatR','testit','digest','rgl','codetools','htmlwidgets','webshot','tikzDevice','tinytex','reticulate','JuliaCall','magick','png','jpeg','gifski','xml2','showtext','tibble','sass','bslib','tidyverse','bigrquery','DBI','glue','geojsonR','fst'), repos='https://cran.rstudio.com/',force=TRUE,dependencies=TRUE)"
RUN mkdir /root/app
COPY R /root/shiny_save
EXPOSE 8080
# RUN dos2unix /usr/bin/shiny-server.sh && apt-get --purge remove -y dos2unix && rm -rf /var/lib/apt/lists/*
CMD ["R", "-e", "shiny::runApp('/root/shiny_save', host='0.0.0.0', port=8080)"]unApp('/root/shiny_save', host='0.0.0.0', port=8080)"]
But when I run inside Docker, several packages are not installed. Like:
Please, why did this occur? Despite the install package specifications, and all the packages are found in cran:
RUN R -e "install.packages(pkgs=c('shiny','leaflet','leaflet.providers','ggplot2','dplyr','shinythemes','ggspatial','googleCloudStorageR','sf','lubridate','googleAuthR','blastula','shinymanager','tiff','raster','scales','sp','RColorBrewer','anytime','rmarkdown','knitr','zip','evaluate','highr','methods','markdown','stringr','yaml','xfun','formatR','testit','digest','rgl','codetools','htmlwidgets','webshot','tikzDevice','tinytex','reticulate','JuliaCall','magick','png','jpeg','gifski','xml2','showtext','tibble','sass','bslib','tidyverse','bigrquery','DBI','glue','geojsonR','fst'), repos='https://cran.rstudio.com/', force=TRUE)"
Thanks in advance!