只有累積,沒有奇蹟

2019年1月27日 星期日

[Docker] Error response from daemon: pull access denied for hello-world

問題
在 Window 10 上安裝完 Docker 後,照著官方文件提到透過 powershell 下 command line 確認安裝是否正常,第一項輸入 docker version 正常順利執行,但下一步 docker run hello-world 就沒那麼順利跳出無法正常執行,錯誤訊息如下所示
  1. PS D:\> docker run hello-world
  2. Unable to find image 'hello-world:latest' locally
  3. C:\Program Files\Docker\Docker\Resources\bin\docker.exe: Error response from daemon: pull access denied for hello-world, repository does not exist or may require 'docker login'.
  4. See 'C:\Program Files\Docker\Docker\Resources\bin\docker.exe run --help'.
  5. PS D:\>
解決方案
解決方式很簡單,在第一次使用 docker run 之前需先做登入的動作(印象中之前不用登入),可以透過兩種方式在 Docker 登入
第一種 : 在 Docker icon 按下右鍵 > 選擇 sign in 
接著在 GUI 上輸入帳號密碼等資訊,即可正常執行
第二種 : 直接在 Powershell 上面打指令 docker login ,輸入 docker id & password 相關資訊,接著在重新執行一次官方文件的 hello-world 即可正常進行說明如下
  1. PS C:\Users\marcustung> docker login
  2. Login with your Docker ID to push and pull images from Docker Hub. If you dont have a Docker ID, head over to https://hub.docker.com to create one.
  3. Username: marcustung
  4. Password:
  5. Login Succeeded
  6. PS C:\Users\marcustung> docker run hello-world
  7.  
  8. Hello from Docker!
  9. This message shows that your installation appears to be working correctly.
  10.  
  11. To generate this message, Docker took the following steps:
  12. 1. The Docker client contacted the Docker daemon.
  13. 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
  14. (amd64)
  15. 3. The Docker daemon created a new container from that image which runs the
  16. executable that produces the output you are currently reading.
  17. 4. The Docker daemon streamed that output to the Docker client, which sent it
  18. to your terminal.
  19.  
  20. To try something more ambitious, you can run an Ubuntu container with:
  21. $ docker run -it ubuntu bash
  22.  
  23. Share images, automate workflows, and more with a free Docker ID:
  24. https://hub.docker.com/
  25.  
  26. For more examples and ideas, visit:
  27. https://docs.docker.com/get-started/
在3-5行可以看到輸入帳號密碼後顯示登入成功,接下來再使用 docker run hello-world 步驟即可看到 Hello from Docker! 可以開始享受 Docker 的強大之處了!!!

參考
Docker hello-world: authentication error

Related Posts:

  • [Docker] Docker for windows 初體驗前言 Docker 是一個 open source 專案,誕生於 2013 年初,Docker 屬於 Linux 容器的一種封裝,提供了簡單且易用的容器接口,在 2016 推出 Docker for windows 版本,相信大家或多或少都聽過甚至已經有在使用,自己也接觸過 docker 一小段時間,但都屬於玩票性質未好好研究,或許在新筆電重新安裝的時候是一個好契機可以靜下心來深入研究,以下簡單介紹 Docker 在 Windows 上的安裝流程… Read More
  • [Docker] 無法刪除 Docker 中的 windowsfilter 資料夾問題  在整理硬碟的時候發現 Docker 資料夾中的 windowsfilter 意外的龐大,佔據主硬碟接近 1/3 的空間不說還以驚人的方式成長,且刪除 windowsfilter 時還會跳出錯誤  拒絕存取資料夾 : 您需具有執行此動作的權限 ,這篇就來分享如何解決這問題,若有謬誤或是更快的方法歡迎留言一起討論。  解決方案  使用 WizTree 硬碟分析工具分析硬碟檔… Read More
  • [CheatSheets] Docker Cheat Sheet 前言  近期新專案陸續有將應用程式用 Docker,每次要用到都會忘記 Docker 指令屢試不爽,因此決定將小抄放置在 BLOG 防止一直 Google 浪費過多生命 圖片來源 Docker Cheatsheet,如有侵權或是不妥請告知 … Read More
  • [Docker] Windows 10 中移除 Docker for Windows 的另一種方式問題  這幾天公司筆電出了點小問題,因此需要將筆電中部分軟體做移除,在進行 Docker for windows 移除時意外的發現卡在預設的 Docker for windows 移除畫面非常久,重試幾次都是跑 10 分鐘以上都未進行到下一步,且移除畫面未提供任何進度,意外中發現不同的方式可以移除 Windows 上的 Docker,且移除速度較預設移除方式來的更快,這篇就來分享如何透過 非一般方式 移除 Docker,若有謬… Read More
  • [CheatSheets] Docker Event State 前言  最近的專案很幸運的都在學習過去未接觸的領域,像是容器化技術 Docker、ASP.NET Core 再搭配 Amazon Elastic Container Service (Amazon ECS ) 管理容器服務,專案開發完到上線之後感覺經驗值加班提升不少,在使用 Docker 時較常使用的像是使用 Docker pull 取得 image、Docker run 運行 image、Docker stop… Read More

0 意見:

張貼留言

Copyright © 2025 m@rcus 學習筆記 | Powered by Blogger

Design by Anders Noren | Blogger Theme by NewBloggerThemes.com