docker - Docker 运行不显示任何输出
问题描述
我在树莓派上安装了 docker(通过 ssh 连接)安装成功。
但是运行docker run hello-world
不会产生任何输出。
请注意,我第一次收到有关安装映像的其他消息
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
ad0f38092cf2: Pull complete
Digest: sha256:e366bc07db5e8a50dbabadd94c2a95d212bc103e3557e47df8a2eebd8bb46309
Status: Downloaded newer image for hello-world:latest
但是 hello world 脚本没有实际输出
注意我使用命令安装了 dockercurl -sSL https://get.docker.com | sh
我也尝试过以下命令
sudo usermod -aG docker pi
sudo systemctl start docker
sudo docker run hello-world
尝试了以下命令 docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
734dd8f733d7 hello-world "/hello" About a minute ago Exited (139) 59 seconds ago thirsty_bhaskara
解决方案
我在 Raspberry Pi 1B+ (armv6l) 上遇到了同样的问题。受@JanDrábek 回答的启发,第一个观察结果是该hello-world
图像确实是支持 ARM 的图像,但只有在使用之后hypriot/armhf-hello-world
,我才得到预期的输出:
$ uname -a
Linux 4.1.19+ #858 Tue Mar 15 15:52:03 GMT 2016 armv6l GNU/Linux
$ docker run hello-world # No output
$ docker image inspect hello-world | grep Architecture # Arch looks right though
"Architecture": "arm",
$ docker run hypriot/armhf-hello-world # This does the job
Hello from Docker.
This message shows that your installation appears to be working correctly.
推荐阅读
- android - 在 Android Room 数据库中使用协程
- c# - 带有字母和数字字符的订单下拉菜单
- javascript - On() click 正在处理最后一个附加的 div,而不是 jquery 中所有附加的 div
- amazon-web-services - 当 ebs 卷崩溃时,如何使 EBS 卷以零停机时间可用并附加到 EC2 实例?
- reactjs - 在 github 用户页面上部署 React 投资组合网站
- prolog - Prolog 尝试打印但出错
- javascript - 如何在 Javascript 中动态验证电子邮件域
- piranha-cms - Piranha CMS - 添加自定义身份验证的问题
- python - 如何使用 python 在无头模式下运行 chrome 驱动程序?
- python - 使用蒙特卡洛在 (0≤≤1,0≤≤1) 范围内的至少两个圆的相交区域