Docker for Windows

來源:互聯網
上載者:User

標籤:container   enter   uil   log   bsp   更改   機器   發布   conf   

安裝包:點擊此處

 

Docker for Windows

 

Get started with Docker for Windows

 

 

 

 

 

環境設值:

  • Shared Drivers:可以將主機(也就是Windows機器)中的磁碟機共用到Docker Container中
  • Advanced:用於配置運行Docker Daemon的虛擬環境的CPU和記憶體
  • Network:配置Docker的網路環境
  • Proxies:代理的配置
  • Docker Daemon:使用JSON格式的設定,對Docker Daemon進行配置,類似於在Linux環境中使用conf檔案對Docker進行配置

 

Docker for Windows的安裝過程會在Hyper-V中建立一台用於運行Docker Daemon的Linux虛擬機器,這個對話方塊中的很多配置也就是針對該虛擬機器所作出的配置。當配置發生更改後,Docker for Windows會重新啟動(小鯨魚背上的小方塊又會動起來),這個過程其實就是這台Linux虛擬機器的配置進行動態調整和重啟的過程。

 

 

在Docker for Windows成功啟動後,就可以在Windows命令提示字元下執行Docker命令了,也可以在Power Shell中執行Docker命令,看個人喜好吧。Docker CLI的體驗和Linux下是一樣的

 

 

使用Docker for Windows在容器中運行ASP.NET Core Web API應用程式

1.首先確保Dockerfile檔案與發布出來的DockerWebAPI應用程式的檔案都在同一個目錄下:

2.啟動power shell,在程式目錄下 執行docker build . -t tagName

  與Linux下編譯Docker Image相比,這裡多了一個安全警告。這是因為我們是在Windows下使用部署在非Windows中的Docker服務來完成的Image的編譯產生,兩套系統中的檔案使用權限設定不同。Docker for Windows建議在編譯產生的Image上對檔案的許可權進行檢查以確保安全。

 

3.docker run 命令

 

  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.
  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.

 

  Type exit to stop the container and close the powershell.

 

4.瀏覽器輸入url ,測試webapi介面

 

 

 

 

 配置

 

Shared Drives

Share your local drives (volumes) with Docker for Windows, so that they are available to your containers.

You will be asked to provide your Windows system username and password (domain user) to apply shared drives. You can select an option to have Docker store the credentials so that you don’t have to re-enter them every time.

 

Docker for Windows

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.