1

I just want to pull the ubuntu image from the docker's repository:

pete@pete-Aspire-4750:~$ sudo docker run ubuntu:14.04 /bin/echo "hello world"    
Unable to find image 'ubuntu:14.04' locally
ubuntu:14.04: The image you are pulling has been verified
53f858aaaf03: Downloading 57.31 MB/197.2 MB 1h57m42s
837339b91538: Download complete
615c102e2290: Download complete
b39b81afc8ca: Download complete     
511136ea3c5a: Already exists 

then nothing happened! is it beacause I'm in China ,so I can't get the image behind the greatwall? or something else?

kknight
  • 19
  • 1
  • 8

2 Answers2

1

The output says that the download is complete. You can do a check by issuing the command sudo docker images. It will list the downloaded images like given below.

REPOSITORY       TAG      IMAGE ID      CREATED      VIRTUAL SIZE   
ubuntu           13.10    5e019ab7bf6d  4 weeks ago  180 MB
  • REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE 511136ea3c5a 19 months ago 0 B pete@pete-Aspire-4750:~$ sudo docker pull ubuntu:14.04 Repository ubuntu already being pulled by another client. Waiting. – kknight Jan 18 '15 at 11:07
  • It seems yout first `docker pull ubuntu` has not completed yet. Try again when `sudo docker images` shows (more or less) a size of 199.3 MB (that is what I have for 14.04). – user2915097 Jan 18 '15 at 11:15
  • yes,I agree. but it's so weird that I've been waiting for 3 more hours..... maybe i have to wait longer....... – kknight Jan 18 '15 at 11:19
  • It just finished......I think maybe just beacuse of my poor bandwidth really thank you~ – kknight Jan 18 '15 at 11:28
0

I'm speculating that it did work. The "hello world" should have appeared at the end. Did you try running the command a second time? Now that the image has been downloaded you should see the result immediately.

Don't forget every time you run the command you're creating a container instance. These will accumulate locally:

$ docker ps -a
CONTAINER ID        IMAGE               COMMAND                CREATED              STATUS                          PORTS               NAMES
9a31ad292a0a        ubuntu:14.04        "/bin/echo 'hello wo   About a minute ago   Exited (0) About a minute ago                       ecstatic_darwin     
035cf18ee6a2        ubuntu:14.04        "/bin/echo 'hello wo   3 minutes ago        Exited (0) 3 minutes ago                            sick_hawking        

A better way to issue the run command is to include the "--rm" option which will automatically delete the container instance when your finishing with them

$ docker run --rm -it ubuntu:14.04 /bin/echo "hello world" 
hello world

Hope this helps.

Networking

Downloading images behind firewalls is not uncommon, but your error message would explicitly show failures (Your output shows "Download complete" messages). This is normally fixed by setting the http proxy environment variable. See:

Community
  • 1
  • 1
Mark O'Connor
  • 76,015
  • 10
  • 139
  • 185