github.com/portworx/docker@v1.12.1/docs/getstarted/step_three.md (about)

     1  <!--[metadata]>
     2  +++
     3  aliases = [
     4  "/mac/step_three/",
     5  "/windows/step_three/",
     6  "/linux/step_three/",
     7  ]
     8  title = "Find & run the whalesay image"
     9  description = "Getting started with Docker"
    10  keywords = ["beginner, getting started, Docker"]
    11  [menu.main]
    12  identifier = "getstart_locate"
    13  parent = "tutorial_getstart_menu"
    14  weight = 3
    15  +++
    16  <![end-metadata]-->
    17  
    18  # Find and run the whalesay image
    19  
    20  People all over the world create Docker images. You can find these images by
    21  browsing the Docker Hub. In this next section, you'll search for and find the
    22  image you'll use in the rest of this getting started.
    23  
    24  ## Step 1: Locate the whalesay image
    25  
    26  1. Open your browser and  <a href="https://hub.docker.com/?utm_source=getting_started_guide&utm_medium=embedded_MacOSX&utm_campaign=find_whalesay" target=_blank> browse to the Docker Hub</a>.
    27  
    28      ![Browse Docker Hub](tutimg/browse_and_search.png)
    29  
    30  	The Docker Hub contains images from individuals like you and official images
    31  	from organizations like RedHat, IBM, Google, and a whole lot more.
    32  
    33  2. Click **Browse & Search**.
    34  
    35      The browser opens the search page.
    36  
    37  3. Enter the word `whalesay` in the search bar.
    38  
    39      ![Browse Docker Hub](tutimg/image_found.png)
    40  
    41  4. Click on the **docker/whalesay** image in the results.
    42  
    43      The browser displays the repository for the **whalesay** image.
    44  
    45      ![Browse Docker Hub](tutimg/whale_repo.png)
    46  
    47  	  Each image repository contains information about an image. It should
    48      include information such as what kind of software the image contains and
    49      how to use it. You may notice that the **whalesay** image is based on a
    50      Linux distribution called Ubuntu. In the next step, you run the **whalesay** image on your machine.
    51  
    52  ## Step 2: Run the whalesay image
    53  
    54  Make sure Docker is running. On Docker for Mac and Docker for Windows, this is indicated by the Docker whale showing in the status bar.
    55  
    56  1. Open a command-line terminal.
    57  
    58  2. Type the `docker run docker/whalesay cowsay boo` command and press RETURN.
    59  
    60      This command runs the **whalesay** image in a container. Your terminal should look like the following:
    61  
    62          $ docker run docker/whalesay cowsay boo
    63          Unable to find image 'docker/whalesay:latest' locally
    64          latest: Pulling from docker/whalesay
    65          e9e06b06e14c: Pull complete
    66          a82efea989f9: Pull complete
    67          37bea4ee0c81: Pull complete
    68          07f8e8c5e660: Pull complete
    69          676c4a1897e6: Pull complete
    70          5b74edbcaa5b: Pull complete
    71          1722f41ddcb5: Pull complete
    72          99da72cfe067: Pull complete
    73          5d5bd9951e26: Pull complete
    74          fb434121fc77: Already exists
    75          Digest: sha256:d6ee73f978a366cf97974115abe9c4099ed59c6f75c23d03c64446bb9cd49163
    76          Status: Downloaded newer image for docker/whalesay:latest
    77           _____
    78          < boo >
    79           -----
    80              \
    81               \
    82                \     
    83                              ##        .            
    84                        ## ## ##       ==            
    85                     ## ## ## ##      ===            
    86                 /""""""""""""""""___/ ===        
    87            ~~~ {~~ ~~~~ ~~~ ~~~~ ~~ ~ /  ===- ~~~   
    88                 \______ o          __/            
    89                  \    \        __/             
    90                    \____\______/   
    91  
    92  	The first time you run a software image, the `docker` command looks for it
    93  	on your local system. If the image isn't there, then `docker` gets it from
    94  	the hub.
    95  
    96  5. While still in the command line terminal, type `docker images` command and press RETURN.
    97  
    98      The command lists all the images on your local system. You should see
    99      `docker/whalesay` in the list.
   100  
   101          $ docker images
   102          REPOSITORY           TAG         IMAGE ID            CREATED            VIRTUAL SIZE
   103          docker/whalesay      latest      fb434121fc77        3 hours ago        247 MB
   104          hello-world          latest      91c95931e552        5 weeks ago        910 B
   105  
   106      When you run an image in a container, Docker downloads the image to your
   107      computer. This local copy of the image saves you time.  Docker only
   108      downloads the image again if the image's source changes on the hub.  You
   109      can, of course, delete the image yourself. You'll learn more about that
   110      later. Let's leave the image there for now because we are going to use it
   111      later.
   112  
   113  6. Take a moment to play with the **whalesay** container a bit.
   114  
   115      Try running the `whalesay` image again with a word or phrase. Try a long or
   116      short phrase.  Can you break the cow?
   117  
   118          $ docker run docker/whalesay cowsay boo-boo
   119           _________
   120          < boo-boo >
   121           ---------
   122              \
   123               \
   124                \     
   125                              ##        .            
   126                        ## ## ##       ==            
   127                     ## ## ## ##      ===            
   128                 /""""""""""""""""___/ ===        
   129            ~~~ {~~ ~~~~ ~~~ ~~~~ ~~ ~ /  ===- ~~~   
   130                 \______ o          __/            
   131                  \    \        __/             
   132                    \____\______/   
   133  
   134  ## Where to go next
   135  
   136  On this page, you learned to search for images on Docker Hub. You used your
   137  command line to run an image. Think about it, effectively you ran a piece of
   138  Linux software on your Mac computer.  You learned that running an image copies
   139  it on your computer.  Now, you are ready to create your own Docker image.
   140  Go on to the next part [to build your own image](step_four.md).
   141  
   142  
   143  &nbsp;