docker在mac上运行ubuntu,没有任何反应

时间:2016-03-02 07:22:54

标签: macos docker

我在Mac上运行:

ubuntu
我做错了什么?我不应该进入{{1}} shell吗?

2 个答案:

答案 0 :(得分:11)

通过运行docker run ubuntu /bin/bash,docker从图片ubuntu创建一个随机命名的容器,并运行bash而不是stdinstdoutstderr,然后{ {1}}退出(刚启动后)。

至少尝试设置tty和交互模式(又名foreground mode):

bash

commented作为physincubus

  
      
  • &#39; docker ps -a # if not exited, stop it first docker stop <container_id> # remove the container which cannot be used docker rm <container_id> # let's try again docker run -it --rm --name=test ubuntu bash &#39;是让它互动的一点,
  •   
  • &#39; -it&#39;退出时移除容器(因此,如果您希望能够退出以进行分离并稍后重新连接,请不要这样做),并且
  •   
  • &#39; --rm&#39;允许您更明确地命名容器,以防您想要运行同一容器的多个实例
  •   

答案 1 :(得分:0)

使用以下命令

运行它
for (i in 1:length(O$Year))
{
   if (Year[i] == "2012") {
      O$SD[i] = C[i]/5408666
   } else if ( Year[i] == "2013") {
      O $SD[i] = C[i]/5300759
   } else if ( Year[i] == "2014") {
      O$SD[i] = C[i]/5410924
   } else if ( Year[i] == "2015") {
      O$SD[i] = C[i]/5446029
   } else if ( Year[i] == "2016") {
      O$SD[i] = C[i]/5480869
   } else 
      O$SD[i] = C[i]
}

**Data set named O** 
   **SD Year C**
     43 2012 4
     23 2012 5
     12 2014 3
     53 2014 3

然后你会得到ubuntu容器的bash提示符