42

I installed docker on a raspberry-pi (Connected via ssh) Installation is successful.

But running docker run hello-world produce no output.

Note on very first time I got additional messages regard installing image

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

But there is no actual output from hello world script

Note I installed docker using command curl -sSL https://get.docker.com | sh

I tried following command too

sudo usermod -aG docker pi
sudo systemctl start docker
sudo docker run hello-world

Tried following commands 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
shakthi
  • 1,597
  • 2
  • 17
  • 29

4 Answers4

25

I ran into the same issue on a Raspberry Pi 1B+ (armv6l). Inspired by @JanDrábek's answer, the first observation is that the hello-world image would indeed be one supporting ARM, yet only after using hypriot/armhf-hello-world instead did I get the expected output:

$ 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.
fuglede
  • 17,388
  • 2
  • 54
  • 99
21

run:

docker ps -a

and check if you can see the exited container.

take the container ID from the output and type

docker logs <ID>

this will allow you to see the logs.

if you want to see the output in the first place when you run it add -it flags to the run command

edit:

I tried in on my machine:

docker run -it hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
d1725b59e92d: Pull complete 
Digest: sha256:e366bc07db5e8a50dbabadd94c2a95d212bc103e3557e47df8a2eebd8bb46309
Status: Downloaded newer image for hello-world:latest

Hello from Docker!
This message shows that your installation appears to be working correctly.

maybe your output is redirected to some other stream. try using :

docker run -it hello-world > ./test.txt 2>&1

after that check if the file has any content

eran meiri
  • 1,322
  • 3
  • 12
  • 29
7

I was having similar issue, my solution was definitely very naive but I basically removed all container and images and then tried again. It worked.

# Delete all containers
docker rm $(docker ps -a -q)
# Delete all images
docker rmi $(docker images -q)
Mihir Bhende
  • 8,677
  • 1
  • 30
  • 37
2

I recently had same problem on my freshly installed Fedora 28 (up-to-date)... the containers all exited with exit code 139, the docker events said that it died, and docker logs said nothing.

My solution was to update the docker (or switch to CE edition) as the installed docker version was 1.13 which is quite old. (The tutorial for fedora https://docs.docker.com/install/linux/docker-ce/fedora/)

Also I have came across one potential thing to check... is your container compatible with your architecture (raspberry is ARM isn't it?) Use docker image inspect <image> search for Architecture.

Jan Drábek
  • 146
  • 6