使用Docker映像运行旧版本的Docker
我想在我的R工作中使用旧R版本的Docker图像。所以我用-使用Docker映像运行旧版本的Docker,r,docker,R,Docker,我想在我的R工作中使用旧R版本的Docker图像。所以我用- docker pull rocker/verse:3.3.2 现在我想运行这个docker映像作为- docker run rocker/verse:3.3.2 这给出了以下回应- [fix-attrs.d] applying owners & permissions fixes... [fix-attrs.d] 00-runscripts: applying... [fix-attrs.d] 00-runscripts
docker pull rocker/verse:3.3.2
现在我想运行这个docker映像作为-
docker run 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...
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.
但在那之后,我看不到任何进展,即使在1小时之后
有没有办法通过docker image使用旧的R版本
谢谢,问题是您没有告诉容器做任何事情。我可以像这样运行一个交互式R终端,所以它似乎可以工作:
$ 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!"
$docker run--rm-it摇滚乐/verse:3.3.2 R
R版本3.3.2(2016-10-31)-“真诚的南瓜补丁”
版权所有(C)2016统计计算基础
平台:x86_64-pc-linux-gnu(64位)
R是免费软件,绝对没有保修。
在某些条件下,欢迎您重新分发。
键入“license()”或“license()”以获取分发详细信息。
R是一个有许多贡献者的协作项目。
键入“contributors()”以获取详细信息和
“引文()”介绍如何在出版物中引用R或R软件包。
对于某些演示,键入“demo()”;对于联机帮助,键入“help()”;或者
“help.start()”用于HTML浏览器界面的帮助。
键入“q()”退出R。
>myString打印(myString)
[1] “你好,世界!”
注意,我在docker run
调用结束时传递了R
命令。结合-it
标志,这将打开集装箱内的交互式R
终端。如您所见,交互式R
终端正在运行3.3.2版
不管怎样,这张图片看起来很好,你只需要决定你想用它做什么
另一个选项是传递bash
而不是R
,然后从那里运行命令。另一种选择是在项目内创建Dockerfile
,该项目在其FROM
中使用此图像,并在构建时将R
脚本复制到容器中。这里列出的选项太多了,但我想你明白了
以下是一些很好的参考资料,可以帮助您入门:
[1] 。(查看-i
和-t
选项)
[2] 你想实现什么目标?您没有向容器传递任何命令,因此我不确定您希望它做什么。我认为这是使用Docker映像处理旧R版本的正确方法。我甚至不能开始运行图像。是否有其他方法启动映像?
$ 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!"