Find and run the whalesay p_w_picpath(尋找和運行whalesay鏡像)
People all over the world create Docker p_w_picpaths.(全世界的人們都可以創建docker p_w_picpaths) You can find these p_w_picpaths by browsing the Docker Hub.(你可以通過瀏覽Docker Hub來尋找這些鏡像) In this next section(在接下來的部分), you’ll do just that to find the p_w_picpath to use in the rest of this getting started.(你僅僅需要做的是在接下來的開始找到這個鏡像去運用)
Step 1: Locate the whale(鯨)say p_w_picpath(定位whalesay鏡像)
Open your browser and browse to the Docker Hub.
The Docker Hub contains p_w_picpaths from individual(個人,個體;個人的,個體的)s like you and official(官方的,正式的) p_w_picpaths from organizations like RedHat, IBM, Google, and a whole lot(大批的) more.
Click Browse & Search.
The browser opens the search page.
Enter the word
whalesay
in the search bar(條,棒).搜索框,搜索條Click on the docker/whalesay p_w_picpath in the results.
The browser displays the repository for the whalesay p_w_picpath.
Each p_w_picpath repository contains information about an p_w_picpath. It should include information such as what kind of software the p_w_picpath contains and how to use it. You may notice that the whalesay p_w_picpath is based on a Linux distribution called Ubuntu. In the next step, you run the whalesay p_w_picpath on your machine.
Step 2: Run the whalesay p_w_picpath
Put your cursor(光標,遊標) in your terminal window at the
$
prompt.Type the
docker run docker/whalesay cowsay boo
command and press RETURN.This command runs the whalesay p_w_picpath in a container. Your terminal should look like the following:
$ docker run docker/whalesay cowsay boo Unable to find p_w_picpath '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 p_w_picpath for docker/whalesay:latest _____ < boo > ----- \ \ \ ## .## ## ## ==## ## ## ## === /""""""""""""""""___/ === ~~~ {~~ ~~~~ ~~~ ~~~~ ~~ ~ / ===- ~~~ \______ o __/ \ \ __/ \____\______/
The first time you run a software p_w_picpath, the
docker
command looks for it on your local system. If the p_w_picpath isn’t there, thendocker
gets it from the hub.While still in the terminal, type
docker p_w_picpaths
command and press RETURN.The command lists all the p_w_picpaths on your local system. You should see
docker/whalesay
in the list.$ docker p_w_picpaths 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 p_w_picpath in a container, Docker downloads the p_w_picpath to your computer. This local copy of the p_w_picpath saves you time. Docker only downloads the p_w_picpath again if the p_w_picpath’s source changes on the hub. You can, of course, delete the p_w_picpath yourself. You’ll learn more about that later. Let’s leave the p_w_picpath there for now because we are going to use it later.
Take a moment to play with the whalesay container a bit.(花一點時間去玩一下whalesay這個鏡像吧)
Try running the
whalesay
p_w_picpath 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 p_w_picpaths on Docker Hub. You used your command line to run an p_w_picpath. You learned that running an p_w_picpath copies it on your computer. Now, you are ready to create your own Docker p_w_picpath. Go on to the next part to build your own p_w_picpath.