title: Docker: how to install RCurl to Docker container?
body: <p>I am trying to install a RCurl to Docker container, remix of <a href="https://github.com/glamp/r-docker/blob/master/Dockerfile" rel="nofollow noreferrer">this</a> Dockerfile, but failure. So </p>
  
  <p><strong>How can I install RCurl to Docker container?</strong></p>
  
  <blockquote>
    <p><strong>Dockerfile</strong></p>
  
  <pre><code>$ cat Dockerfile 
  FROM r-base 
  RUN apt-get -y install r-base
  RUN pip install rpy2
  RUN apt-get -y install libcurl4-openssl-dev
  #setup R configs
  RUN echo "r &lt;- getOption('repos'); r['CRAN'] &lt;- 'http://cran.us.r-project.org'; options(repos = r);" &gt; ~/.Rprofile
  RUN Rscript -e "install.packages('yhatr')"
  RUN Rscript -e "install.packages('ggplot2')"
  RUN Rscript -e "install.packages('plyr')"
  RUN Rscript -e "install.packages('reshape2')"
  RUN Rscript -e "install.packages('forecast')"
  RUN Rscript -e "install.packages('stringr')"
  RUN Rscript -e "install.packages('lubridate')"
  RUN Rscript -e "install.packages('randomForest')"
  RUN Rscript -e "install.packages('rpart')"
  RUN Rscript -e "install.packages('e1071')"
  RUN Rscript -e "install.packages('kknn')"
  RUN Rscript -e "install.packages('RCurl')"
  RUN Rscript -e "install.packages('rjson')"
  </code></pre>
    
    <p><strong>Docker instalaltion failure</strong></p>
  
  <pre><code>trying URL 'https://cran.rstudio.com/src/contrib/RCurl_1.95-4.8.tar.gz'
  Content type 'application/x-gzip' length 916934 bytes (895 KB)
  ==================================================
  downloaded 895 KB
  
  * installing *source* package ‘bitops’ ...
  ** package ‘bitops’ successfully unpacked and MD5 sums checked
  ** libs
  gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG      -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-3.3.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c bit-ops.c -o bit-ops.o
  gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG      -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-3.3.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c cksum.c -o cksum.o
  gcc -std=gnu99 -shared -L/usr/lib/R/lib -Wl,-z,relro -o bitops.so bit-ops.o cksum.o -L/usr/lib/R/lib -lR
  installing to /usr/local/lib/R/site-library/bitops/libs
  ** R
  ** preparing package for lazy loading
  ** help
  *** installing help indices
  ** building package indices
  ** testing if installed package can be loaded
  * DONE (bitops)
  * installing *source* package ‘RCurl’ ...
  ** package ‘RCurl’ successfully unpacked and MD5 sums checked
  checking for curl-config... no
  Cannot find curl-config
  ERROR: configuration failed for package ‘RCurl’
  * removing ‘/usr/local/lib/R/site-library/RCurl’
  
  The downloaded source packages are in
    ‘/tmp/RtmpJrfUvL/downloaded_packages’
  Warning message:
  In install.packages("RCurl") :
    installation of package ‘RCurl’ had non-zero exit status
   ---&gt; b8de6bc67379
  Removing intermediate container e8c17d0306ef
  </code></pre>
  </blockquote>