码迷,mamicode.com
首页 > 其他好文 > 详细

Find and run the whalesay image

时间:2016-05-17 19:51:29      阅读:173      评论:0      收藏:0      [点我收藏+]

标签:docker find whalesay image

Find and run the whalesay image(寻找和运行whalesay镜像)

People all over the world create Docker images.(全世界的人们都可以创建docker images) You can find these images by browsing the Docker Hub.(你可以通过浏览Docker Hub来寻找这些镜像) In this next section(在接下来的部分), you’ll do just that to find the image to use in the rest of this getting started.(你仅仅需要做的是在接下来的开始找到这个镜像去运用)

Step 1: Locate the whale(鲸)say image(定位whalesay镜像)

  1. Open your browser and browse to the Docker Hub.

    技术分享

    The Docker Hub contains images from individual(个人,个体;个人的,个体的)s like you and official(官方的,正式的) images from organizations like RedHat, IBM, Google, and a whole lot(大批的) more.

  2. Click Browse & Search.

    The browser opens the search page.

  3. Enter the word whalesay in the search bar(条,棒).搜索框,搜索条

    技术分享
  4. Click on the docker/whalesay image in the results.

    The browser displays the repository for the whalesay image.

    技术分享

    Each image repository contains information about an image. It should include information such as what kind of software the image contains and how to use it. You may notice that the whalesay image is based on a Linux distribution called Ubuntu. In the next step, you run the whalesay image on your machine.

Step 2: Run the whalesay image

  1. Put your cursor(光标,游标) in your terminal window at the $ prompt.

  2. Type the docker run docker/whalesay cowsay boo command and press RETURN.

    This command runs the whalesay image in a container. Your terminal should look like the following:

    $ docker run docker/whalesay cowsay boo
    Unable to find image ‘docker/whalesay:latest‘ locally
    latest: Pulling from docker/whalesay
    e9e06b06e14c: Pull complete
    a82efea989f9: Pull complete37bea4ee0c81: Pull complete07f8e8c5e660: Pull complete676c4a1897e6: Pull complete5b74edbcaa5b: Pull complete1722f41ddcb5: Pull complete99da72cfe067: Pull complete5d5bd9951e26: Pull complete
    fb434121fc77: Already exists
    Digest: sha256:d6ee73f978a366cf97974115abe9c4099ed59c6f75c23d03c64446bb9cd49163
    Status: Downloaded newer image for docker/whalesay:latest
     _____
    < boo >
     -----
                   \                    ##        .## ## ##       ==## ## ## ##      ===
           /""""""""""""""""___/ ===
      ~~~ {~~ ~~~~ ~~~ ~~~~ ~~ ~ /  ===- ~~~
           \______ o          __/
            \    \        __/
              \____\______/

    The first time you run a software image, the docker command looks for it on your local system. If the image isn’t there, then docker gets it from the hub.

  3. While still in the terminal, type docker images command and press RETURN.

    The command lists all the images on your local system. You should see docker/whalesay in the list.

    $ docker images
    REPOSITORY           TAG         IMAGE ID            CREATED            VIRTUAL SIZE
    docker/whalesay      latest      fb434121fc77        3 hours ago        247 MB
    hello-world          latest      91c95931e552        5 weeks ago        910 B

    When you run an image in a container, Docker downloads the image to your computer. This local copy of the image saves you time. Docker only downloads the image again if the image’s source changes on the hub. You can, of course, delete the image yourself. You’ll learn more about that later. Let’s leave the image there for now because we are going to use it later.

  4. Take a moment to play with the whalesay container a bit.(花一点时间去玩一下whalesay这个镜像吧)

    Try running the whalesay image again with a word or phrase. Try a long or short phrase. Can you break the cow?

    $ docker run docker/whalesay cowsay boo-boo
     _________
    < boo-boo >
     ---------
                   \     
                        ##        .            ## ## ##       ==            ## ## ## ##      ===            
           /""""""""""""""""___/ ===        
      ~~~ {~~ ~~~~ ~~~ ~~~~ ~~ ~ /  ===- ~~~   
           \______ o          __/            
            \    \        __/             
              \____\______/

Where to go next

On this page, you learned to search for images on Docker Hub. You used your command line to run an image. You learned that running an image copies it on your computer. Now, you are ready to create your own Docker image. Go on to the next part to build your own image.


原文:https://docs.docker.com/linux/step_three/

本文出自 “Zcy.gy” 博客,请务必保留此出处http://1064187464.blog.51cto.com/9108437/1774406

Find and run the whalesay image

标签:docker find whalesay image

原文地址:http://1064187464.blog.51cto.com/9108437/1774406

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!