title: Running plumber API on Docker container
body: <p>I would like to run plumber API on Docker container.</p>
  <p>I tried the following two dockerfiles:</p>
  <p>The first Dockerfile</p>
  <pre><code>FROM rstudio/plumber
  MAINTAINER Docker User &lt;docker@user.org&gt;
  RUN R -e &quot;install.packages('broom')&quot;
  RUN mkdir -p ~/application
  
  # copy everything from the current directory into the container
  COPY &quot;/&quot; &quot;application/&quot;
  WORKDIR &quot;application/&quot; 
  
  # open port 80 to traffic
  EXPOSE 80
  
  # when the container starts, start the main.R script
  ENTRYPOINT [&quot;Rscript&quot;, &quot;execute_plumber.R&quot;]
  </code></pre>
  <p>The second Dockerfile:</p>
  <pre><code>FROM rocker/r-ver:4.0.2
  
  # install the linux libraries needed for plumber
  RUN apt-get update -qq &amp;&amp; apt-get install -y \
    libssl-dev \
    libcurl4-gnutls-dev
  
  # install plumber
  RUN R -e &quot;install.packages('plumber')&quot;
  RUN mkdir -p ~/application
  
  # copy everything from the current directory into the container
  COPY &quot;/&quot; &quot;application/&quot;
  WORKDIR &quot;application/&quot; 
  
  # open port 80 to traffic
  EXPOSE 80
  
  # when the container starts, start the main.R script
  ENTRYPOINT [&quot;Rscript&quot;, &quot;execute_plumber.R&quot;]
  </code></pre>
  <p>Both of them resulted in the following error:</p>
  <pre><code>* Downloading renv 0.12.0 from CRAN archive ... OK
  * Installing renv 0.12.0 ... Done!
  Successfully installed and loaded renv 0.12.0.
  Error in library(plumber) : there is no package called ‘plumber’
  Execution halted
  </code></pre>
  <p>In case of the second Dockerfile I also tried to install different linux libraries such</p>
  <pre><code>git-core
  libcurl4-openssl-dev
  xml2 openssl
  </code></pre>
  <p>None of them helped.</p>
  <p>I am running it on Azure. Any suggestions?</p>
  <p><strong>UPDATE</strong>
  In container build log file I can clearly see the <code>plumber</code> was successfully installed.</p>
  <pre><code>&gt; install.packages('plumber')
  Installing package into ‘/usr/local/lib/R/site-library’
  (as ‘lib’ is unspecified)
  also installing the dependencies ‘curl’, ‘Rcpp’, ‘later’, ‘BH’, ‘rlang’, ‘glue’, ‘R6’, ‘stringi’, ‘jsonlite’, ‘webutils’, ‘httpuv’, ‘crayon’, ‘promises’, ‘sodium’, ‘swagger’, ‘magrittr’, ‘mime’, ‘lifecycle’
  
  ...
  
  * DONE (plumber)
  </code></pre>