简体   繁体   English

使用docker运行容器时出错

[英]Error while running a container using docker

I have installed docker in my machine I could successfully pull images from the repository and the pulled images are clearly listed when I see the list of images pulled. 我已经在我的机器中安装了docker我可以成功地从存储库中提取图像,当我看到拉出的图像列表时,清楚地列出了拉出的图像。 The docker service was also started using docker服务也开始使用

sudo service docker start

However, when I try to run the same using the command, 但是,当我尝试使用命令运行相同的时候,

sudo docker run -it ubuntu:12.04 

I am getting the following error 我收到以下错误

docker: Error response from daemon: Container command '/bin/bash' not found or does not exist.. docker:来自守护程序的错误响应:未找到或不存在容器命令'/ bin / bash'。

The issue remains the same for any image that I have tried with What could be the reason for this issue? 对于我尝试过的任何图像,问题仍然存在。这可能是什么原因造成的?

It depends on your version of docker, but check if you have issue 23411 , where adding a workdir is needed: 这取决于你的docker版本,但检查你是否有问题23411 ,需要添加workdir

sudo docker run --workdir /var -it ubuntu:12.04 

There seem to be some recent bug in start.go , and a PR in progress . start.go似乎有一些最近的错误, PR正在进行中

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM