docker aws.s3 package installed for R enviroment but not found while Docker run image

183 views Asked by At
# dockerfile
FROM requiredimg
#FROM rocker/r-rmd:latest

WORKDIR /parentfolder
COPY . .
WORKDIR /parentfolder

RUN R -e "install.packages('aws.s3', repos = c('https://RForge.net', 'https://cloud.R-project.org'))"
# CMD cd scripts"
# CMD ls
CMD Rscript -e "rmarkdown::render('scripts/appfinal.Rmd',params=list(runtime = 'local'))"

nan@NaN:~/Desktop/parentfolder/folder$ sudo docker build -t appimg -f app.Dockerfile .
Sending build context to Docker daemon  27.51MB
Step 1/6 : FROM requiredbaseimg
 ---> e76fcedf662a
Step 2/6 : WORKDIR /parentfolder
 ---> Using cache
 ---> be62cecc5ddd
Step 3/6 : COPY . .
 ---> 0f2f1e7e693f
Step 4/6 : WORKDIR /parentfolder
 ---> Running in 0c8ee85b7585
Removing intermediate container 0c8ee85b7585
 ---> 17d7cb54ef67
Step 5/6 : RUN R -e "install.packages('aws.s3', repos = c('https://RForge.net', 'https://cloud.R-project.org'))"
 ---> Running in a7fd0c677b3r

R version 4.0.1 (2020-06-06) -- "See Things Now"
Copyright (C) 2020 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

  Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> install.packages('aws.s3', repos = c('https://RForge.net', 'https://cloud.R-project.org'))
Installing package into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)
also installing the dependencies ‘openssl’, ‘curl’, ‘httr’, ‘xml2’

trying URL 'https://cloud.R-project.org/src/contrib/openssl_2.0.0.tar.gz'
Content type 'application/x-gzip' length 1200448 bytes (1.1 MB)
==================================================
downloaded 1.1 MB

trying URL 'https://cloud.R-project.org/src/contrib/curl_4.3.2.tar.gz'
Content type 'application/x-gzip' length 793345 bytes (774 KB)
==================================================
downloaded 774 KB

trying URL 'https://cloud.R-project.org/src/contrib/httr_1.4.2.tar.gz'
Content type 'application/x-gzip' length 159950 bytes (156 KB)
==================================================
downloaded 156 KB

trying URL 'https://cloud.R-project.org/src/contrib/xml2_1.3.3.tar.gz'
Content type 'application/x-gzip' length 283965 bytes (277 KB)
==================================================
downloaded 277 KB

trying URL 'https://RForge.net/src/contrib/aws.s3_0.3.22.tar.gz'
Content type 'application/octet-stream' length 53639 bytes (52 KB)
==================================================
downloaded 52 KB

* installing *source* package ‘openssl’ ...
** package ‘openssl’ successfully unpacked and MD5 sums checked
** using staged installation
Using PKG_CFLAGS=
--------------------------- [ANTICONF] --------------------------------
Configuration failed because openssl was not found. Try installing:
 * deb: libssl-dev (Debian, Ubuntu, etc)
 * rpm: openssl-devel (Fedora, CentOS, RHEL)
 * csw: libssl_dev (Solaris)
 * brew: [email protected] (Mac OSX)
If openssl is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a openssl.pc file. If pkg-config
is unavailable you can set INCLUDE_DIR and LIB_DIR manually via:
R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'
-------------------------- [ERROR MESSAGE] ---------------------------
tools/version.c:1:10: fatal error: openssl/opensslv.h: No such file or directory
    1 | #include <openssl/opensslv.h>
      |          ^~~~~~~~~~~~~~~~~~~~
compilation terminated.
--------------------------------------------------------------------
ERROR: configuration failed for package ‘openssl’
* removing ‘/usr/local/lib/R/site-library/openssl’
* installing *source* package ‘curl’ ...
** package ‘curl’ successfully unpacked and MD5 sums checked
** using staged installation
Package libcurl was not found in the pkg-config search path.
Perhaps you should add the directory containing `libcurl.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libcurl' found
Package libcurl was not found in the pkg-config search path.
Perhaps you should add the directory containing `libcurl.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libcurl' found
Using PKG_CFLAGS=
Using PKG_LIBS=-lcurl
------------------------- ANTICONF ERROR ---------------------------
Configuration failed because libcurl was not found. Try installing:
 * deb: libcurl4-openssl-dev (Debian, Ubuntu, etc)
 * rpm: libcurl-devel (Fedora, CentOS, RHEL)
 * csw: libcurl_dev (Solaris)
If libcurl is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a libcurl.pc file. If pkg-config
is unavailable you can set INCLUDE_DIR and LIB_DIR manually via:
R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'
--------------------------------------------------------------------
ERROR: configuration failed for package ‘curl’
* removing ‘/usr/local/lib/R/site-library/curl’
* installing *source* package ‘xml2’ ...
** package ‘xml2’ successfully unpacked and MD5 sums checked
** using staged installation
Package libxml-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `libxml-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libxml-2.0' found
Package libxml-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `libxml-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libxml-2.0' found
Using PKG_CFLAGS=
Using PKG_LIBS=-lxml2
------------------------- ANTICONF ERROR ---------------------------
Configuration failed because libxml-2.0 was not found. Try installing:
 * deb: libxml2-dev (Debian, Ubuntu, etc)
 * rpm: libxml2-devel (Fedora, CentOS, RHEL)
 * csw: libxml2_dev (Solaris)
If libxml-2.0 is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a libxml-2.0.pc file. If pkg-config
is unavailable you can set INCLUDE_DIR and LIB_DIR manually via:
R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'
--------------------------------------------------------------------
ERROR: configuration failed for package ‘xml2’
* removing ‘/usr/local/lib/R/site-library/xml2’
ERROR: dependencies ‘curl’, ‘openssl’ are not available for package ‘httr’
* removing ‘/usr/local/lib/R/site-library/httr’
ERROR: dependencies ‘curl’, ‘httr’, ‘xml2’ are not available for package ‘aws.s3’
* removing ‘/usr/local/lib/R/site-library/aws.s3’

The downloaded source packages are in
        ‘/tmp/RtmpI01bdK/downloaded_packages’
Warning messages:
1: In install.packages("aws.s3", repos = c("https://RForge.net", "https://cloud.R-project.org")) :
  installation of package ‘openssl’ had non-zero exit status
2: In install.packages("aws.s3", repos = c("https://RForge.net", "https://cloud.R-project.org")) :
  installation of package ‘curl’ had non-zero exit status
3: In install.packages("aws.s3", repos = c("https://RForge.net", "https://cloud.R-project.org")) :
  installation of package ‘xml2’ had non-zero exit status
4: In install.packages("aws.s3", repos = c("https://RForge.net", "https://cloud.R-project.org")) :
  installation of package ‘httr’ had non-zero exit status
5: In install.packages("aws.s3", repos = c("https://RForge.net", "https://cloud.R-project.org")) :
  installation of package ‘aws.s3’ had non-zero exit status
> 
> 
Removing intermediate container a7fd0c677b3f
 ---> 0acd2cecad5f
Step 6/6 : CMD Rscript -e "rmarkdown::render('scripts/appfinal.Rmd',params=list(runtime = 'local'))"
 ---> Running in 7c9841540724
Removing intermediate container 7c9841540724
 ---> 0e2adea5610d
Successfully built 0e2adea5610d
Successfully tagged appfimg:latest



ERROR: configuration failed for package ‘xml2’* removing ‘/usr/local/lib/R/site-library/xml2’ERROR: dependencies ‘curl’, ‘openssl’ are not available for package ‘httr’* removing ‘/usr/local/lib/R/site-library/httr’

ERROR: dependencies ‘curl’, ‘httr’, ‘xml2’ are not available for package ‘aws.s3’* removing ‘/usr/local/lib/R/site-library/aws.s3’

The downloaded source packages are in'/tmp/RtmpiZasds/downloaded_packages'Quitting from lines 11-25 (appfinal.Rmd)

Error in library(aws.s3) : there is no package called 'aws.s3'Calls: <Anonymous> ... withCallingHandlers -> withVisible -> eval -> eval -> library

Execution halted

> BUILD SUCCESFULLY COMPLETED > BUT AS YOU CAN SEE THERE WAS SOME CONFIGURATION FAILED DURING BUILD.

> Now Below snippets > THIS ERRORS OCCURED WHILE WE RUN THAT IMAGE

after installing aws.s3 it should not show any discrepency of pacakge not found.

i have installed the package but idon't know what is the issue here

0

There are 0 answers