在win 10上安裝好Docker后,根據(jù)官方文檔示例運(yùn)行命令:docker run hello-world
金度,報(bào)錯(cuò):
C:\Users\stein>docker run hello-wrold
Unable to find image 'hello-wrold:latest' locally
docker: Error response from daemon: pull access denied for hello-wrold, repository does not exist or may require 'docker login'.
根據(jù)錯(cuò)誤提示是:repository不存在或者需要運(yùn)行docker login登錄逾柿,但是根據(jù)官方文檔:在docker hub中搜索或者拉去images時(shí)并不需要賬戶并且登錄氛什,如圖1:
于是七芭,轉(zhuǎn)而去配置repository,事實(shí)發(fā)現(xiàn)并沒有卵用照卦,只好google之式矫,在Stackoverflow上的這個(gè)回答Docker hello-world: authentication error中可以找到一些線索:
根據(jù)圖2來看,還是需要使用賬號(hào)和密碼去登錄的役耕,不然也不會(huì)有那么多人問這個(gè)相關(guān)的問題采转;
于是乖乖的去創(chuàng)建Docker id,然后在運(yùn)行docker run hello-world
命令之前先使用命令docker login
登錄蹄葱,過程如下:
C:\Users\stein>docker login
Login with your Docker ID to push and pull images from Docker Hub. If you don't have a Docker ID, head over to [https://hub.docker.com](https://hub.docker.com/) to create one.
Username: daoyi
Password:
Login Succeeded
C:\Users\stein>docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
ca4f61b1923c: Pull complete
Digest: sha256:66ef312bbac49c39a89aa9bcc3cb4f3c9e7de3788c944158df3ee0176d32b751
Status: Downloaded newer image for hello-world:latest
Hello from Docker!
This message shows that your installation appears to be working correctly.
To generate this message, Docker took the following steps:
1\. The Docker client contacted the Docker daemon.
2\. The Docker daemon pulled the "hello-world" image from the Docker Hub.
(amd64)
3\. The Docker daemon created a new container from that image which runs the
executable that produces the output you are currently reading.
4\. The Docker daemon streamed that output to the Docker client, which sent it
to your terminal.
To try something more ambitious, you can run an Ubuntu container with:
$ docker run -it ubuntu bash
Share images, automate workflows, and more with a free Docker ID:
[https://cloud.docker.com/](https://cloud.docker.com/)
For more examples and ideas, visit:
[https://docs.docker.com/engine/userguide/](https://docs.docker.com/engine/userguide/)