Reputation: 3308
I want to use Docker image of old R version for my R work. So I used -
docker pull rocker/verse:3.3.2
Now I want to run this docker image as -
docker run rocker/verse:3.3.2
This gives below response -
[fix-attrs.d] applying owners & permissions fixes...
[fix-attrs.d] 00-runscripts: applying...
[fix-attrs.d] 00-runscripts: exited 0.
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] add: executing...
Nothing additional to add
[cont-init.d] add: exited 0.
[cont-init.d] userconf: executing...
ERROR: You must set a unique PASSWORD (not 'rstudio') first! e.g. run with:
docker run -e PASSWORD=<YOUR_PASS> -p 8787:8787 rocker/rstudio
[cont-init.d] userconf: exited 1.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
After this, it stops responding.
I also tried using a passcode as below -
sudo docker run -e PASSWORD=abc$ -p 8787:8787 rocker/verse:3.3.2
[fix-attrs.d] applying owners & permissions fixes...
[fix-attrs.d] 00-runscripts: applying...
[fix-attrs.d] 00-runscripts: exited 0.
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] add: executing...
Nothing additional to add
[cont-init.d] add: exited 0.
[cont-init.d] userconf: executing...
[cont-init.d] userconf: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
But after that I see no progress even after 1 hour.
Is there any way to use old R version through docker image?
Thanks,
Upvotes: 1
Views: 501
Reputation: 636
The problem is that you aren't telling the container to do anything. I can run an interactive R terminal like this, so it seems to be working:
$ docker run --rm -it rocker/verse:3.3.2 R
R version 3.3.2 (2016-10-31) -- "Sincere Pumpkin Patch"
Copyright (C) 2016 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.
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.
> myString <- "Hello, World!"
> print (myString)
[1] "Hello, World!"
Notice I'm passing the R
command at the end of my docker run
call. Combined with the -it
flags, this will open an interactive R
terminal inside of the container. As you can see, the interactive R
terminal is running version 3.3.2.
Anyway, this image seems to be working just fine, you just need to decide what you want to do with it.
Another option would be passing bash
instead of R
then running commands from there. Yet another option is to create a Dockerfile
inside a project that uses this image in it's FROM
and copies R
scripts into the container at build-time. There are too many options to list here, but I think you get the point.
Here are some good references to get you started:
[1] https://docs.docker.com/engine/reference/commandline/run/. (look at the -i
and -t
options)
[2] https://docs.docker.com/engine/reference/builder/
Upvotes: 1