windows server 2016安裝docker


最近微軟發布了windows server 2016,並原生支持docker,本文通過一系列的步驟,來學習怎么在windows server 2016安裝docker。

1、下載 windows server 2016 180天評估版本。

     地址:https://www.microsoft.com/en-us/evalcenter/evaluate-windows-server-2016?i=1

 

2、安裝windows server 2016

     安裝過程類似於window10 ,可根據需要是否安裝GUI。

 

3、更新系統到最新版本

     打開powershell 輸入命令“sconfig",選擇6下載並安裝更新。

===============================================================================
                         服務器配置
===============================================================================

1) 域/工作組:                   工作組:  WORKGROUP
2) 計算機名:                    WIN-GHUNK220OOQ
3) 添加本地管理員
4) 配置遠程管理                 已啟用

5) Windows 更新設置:            僅下載
6) 下載並安裝更新
7) 遠程桌面:                    已啟用(所有客戶端)

8) 網絡設置
9) 日期和時間
10) 遙測設置基本
11) Windows 激活

12) 注銷用戶
13) 重新啟動服務器
14) 關閉服務器
15) 退出到命令行

 

    

4、安裝docker

首先安裝oneget PowerShell模塊

Install-Module -Name DockerMsftProvider -Repository PSGallery -Force

再使用oneget 安裝最新版本docker

Install-Package -Name docker -ProviderName DockerMsftProvide

powershell中詢問你是否確實要安裝來自“DockerDefault”的軟件,選擇“A”全是。

PS C:\> Install-Module -Name DockerMsftProvider -Repository PSGallery -Force
PS C:\> Install-Package -Name docker -ProviderName DockerMsftProvider

程序包來自未標記為“受信任”的程序包源。
是否確實要安裝來自“DockerDefault”的軟件?
[Y] 是(Y)  [A] 全是(A)  [N] 否(N)  [L] 全否(L)  [S] 暫停(S)  [?] 幫助 (默認值為“N”): A 警告: A restart is required to start docker service. Please restart your machine.
警告: After the restart please start the docker service.

Name                           Version          Source           Summary
----                           -------          ------           -------
Docker                         1.12.2-cs2-ws... DockerDefault    Contains the CS Docker Engine for use with Windows ...

 安裝完成重啟計算機

Restart-Computer -Force

在powershell中輸入,docker version,顯示docker版本

PS C:\Users\Administrator> docker version
Client:
 Version:      1.12.2-cs2-ws-beta
 API version:  1.25
 Go version:   go1.7.1
 Git commit:   050b611
 Built:        Tue Oct 11 02:35:40 2016
 OS/Arch:      windows/amd64

Server:
 Version:      1.12.2-cs2-ws-beta
 API version:  1.25
 Go version:   go1.7.1
 Git commit:   050b611
 Built:        Tue Oct 11 02:35:40 2016
 OS/Arch:      windows/amd64

 

5、安裝第一個docker容器
使用docker run 部署一個.net core hellworld官方應用程序鏡像

docker run microsoft/dotnet-samples:dotnetapp-nanoserver

 會看到跟linux部署容器一樣的界面

PS C:\Users\Administrator>docker run microsoft/dotnet-samples:dotnetapp-nanoserver
Unable to find image 'microsoft/dotnet-samples:dotnetapp-nanoserver' locally
dotnetapp-nanoserver: Pulling from microsoft/dotnet-samples
5496abde368a: Downloading [===>                                               ]  14.6 MB/242.6 MB
482ab31872a2: Downloading [=========>                                         ] 19.46 MB/100.5 MB
df00079eb06a: Download complete
79730b122a0a: Download complete
e2f5db19e1d2: Downloading [===>                                               ] 2.293 MB/32.48 MB
c34ebc4d7351: Waiting
8c97c2cd28c1: Waiting
6bd62be70d1c: Waiting
9b45b5fe5811: Waiting

 

 參考文章:

https://msdn.microsoft.com/virtualization/windowscontainers/containers_welcome


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM