Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

102
Views
Custom R Source package in Docker

InfrastructureR_0.1.4.tar.gz is a R source package that I created using RStudio in windows and it works fine. But when I try to use it in docker file with the command InfrastructureR_0.1.4.tar.gz is located in the same location as Docker file

Docker is running on ubuntu 18.x machine

RUN R -e "install.packages('InfrastructureR_0.1.4.tar.gz', dependencies=FALSE, verbose=TRUE, repos=NULL, type='source')" it doesn't install.

I run the docker build by sudo docker build -t myRApp s . and I get the following error message

Installing package into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)
system (cmd0): /usr/lib/R/bin/R CMD INSTALL
Warning: invalid package ‘InfrastructureR_0.1.4.tar.gz’
Error: ERROR: no packages specified
Warning message:
In install.packages("InfrastructureR_0.1.4.tar.gz", dependencies = FALSE,  :
  installation of package ‘InfrastructureR_0.1.4.tar.gz’ had non-zero exit status

So how do I install a custom R source package in Docker

over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

It is not enough to have your tar.gz file in the same directory as your Dockerfile. To make a local file available to a Docker container created from an image, you can use the COPY instruction.

The COPY instruction copies new files or directories from <src> and adds them to the filesystem of the container at the path <dest>:

COPY [--chown=<user>:<group>] <src>... <dest> 

More in the docker docs:

  • https://docs.docker.com/engine/reference/builder/#copy
over 4 years ago · Santiago Trujillo Report

0

I think the package needs to be copied inside the container so that the container can access it. (or in a location volume that docker has access to)

R running inside the container cannot find the file.

https://www.digitalocean.com/community/tutorials/how-to-share-data-between-the-docker-container-and-the-host

https://docs.docker.com/storage/bind-mounts/

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!