Plumber Dockerfile

I am trying to deploy a plumber API by using docker.

This is my dockerfile

FROM rocker/r-ver:3.5.0
RUN apt-get update -qq && apt-get install -y \
      libssl-dev \
      libcurl4-gnutls-dev
RUN Rscript -e "install.packages(c('shiny', 'plumber', 'tidyverse', 'readxl'), repos='https://cloud.r-project.org/')"
COPY / /
EXPOSE 80
ENTRYPOINT ["Rscript", "plumber.R"]

When i start my container the docker log give an error of

the plumber package is not installed

Could you help me to solve this?

Dear all i solved the problem with the follow dockerfile

FROM rocker/verse:4.2.0
RUN apt-get update && apt-get install -y  git-core libcurl4-openssl-dev libgit2-dev libicu-dev libsodium-dev libssl-dev libxml2-dev make pandoc pandoc-citeproc zlib1g-dev && rm -rf /var/lib/apt/lists/*
RUN echo "options(repos = c(CRAN = 'https://cran.rstudio.com/'), download.file.method = 'libcurl', Ncpus = 4)" >> /usr/local/lib/R/etc/Rprofile.site

# install the randomForest package
RUN R -e 'install.packages("remotes")'
RUN Rscript -e 'remotes::install_version("tidyverse",upgrade="never", version = "1.3.2")'
RUN Rscript -e 'remotes::install_version("plumber",upgrade="never", version = "1.2.0")'

RUN mkdir /build_zone
ADD . /build_zone
WORKDIR /build_zone

EXPOSE 8000

ENTRYPOINT ["R", "-e", "library(plumber); library(tidyverse); library(readxl); plumb('plumber.R')$run(port=8000, host='0.0.0.0')"]

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.