Windows 2022
Sponsored Link

Docker : インストール2022/01/21

 
コンテナー型仮想化ツール Docker をインストールして、Windows Container が利用できるよう設定します。
[1] PowerShell を管理者権限で起動してインストールします。
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

# コンテナー機能インストール
# インストール後 [Y] で再起動
PS C:\Users\Administrator> Enable-WindowsOptionalFeature -Online -FeatureName Containers 
Do you want to restart the computer to complete this operation now?
[Y] Yes  [N] No  [?] Help (default is "Y"): Y

# 再起動後 Docker インストール
PS C:\Users\Administrator> Install-Module -Name DockerMsftProvider -Repository PSGallery -Force 

NuGet provider is required to continue
PowerShellGet requires NuGet provider version '2.8.5.201' or newer to interact with NuGet-based repositories. The NuGet
provider must be available in 'C:\Program Files\PackageManagement\ProviderAssemblies' or
'C:\Users\Administrator\AppData\Local\PackageManagement\ProviderAssemblies'. You can also install the NuGet provider by running
 'Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force'. Do you want PowerShellGet to install and import the
NuGet provider now?
[Y] Yes  [N] No  [S] Suspend  [?] Help (default is "Y"): Y

PS C:\Users\Administrator> Install-Package -Name docker -ProviderName DockerMsftProvider 

The package(s) come(s) from a package source that is not marked as trusted.
Are you sure you want to install software from 'DockerDefault'?
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "N"): Y

Name                           Version          Source           Summary
----                           -------          ------           -------
Docker                         20.10.7          DockerDefault    Contains Docker EE for use with Windows Server.

# 一旦 再起動
PS C:\Users\Administrator> Restart-Computer -Force 

# 再起動後 確認
PS C:\Users\Administrator> docker version 
Client: Mirantis Container Runtime
 Version:           20.10.7
 API version:       1.41
 Go version:        go1.13.15
 Git commit:        40ef3b6
 Built:             08/19/2021 18:54:26
 OS/Arch:           windows/amd64
 Context:           default
 Experimental:      true

Server: Mirantis Container Runtime
 Engine:
  Version:          20.10.7
  API version:      1.41 (minimum version 1.24)
  Go version:       go1.13.15
  Git commit:       e1bf5b9c13
  Built:            08/19/2021 18:53:20
  OS/Arch:          windows/amd64
  Experimental:     false
Docker : インストール (GUI)
 
GUI でインストールする場合は以下のように設定します。
[2] [スタート] - [サーバーマネージャー] を起動し、[役割と機能の追加] から機能の追加のセクションで、以下のように [コンテナー] を選択してインストールします。インストール後は再起動が必要です。
[3]
再起動後、PowerShell を管理者で起動し、以下のようにコマンド入力して Docker をインストールします。
インストール中の問いには全て Y (Yes) で応答します。
PS > Install-Module -Name DockerMsftProvider -Repository PSGallery -Force
PS > Install-Package -Name docker -ProviderName DockerMsftProvider
[4] インストール完了後は、以下のように、スタートアップ [自動] で [Docker Engine] サービスが登録されます。ここで一旦、再びシステムを再起動します。
[5]
再起動後、PowerShell を起動し、以下のようにコマンド入力して正常に応答が返ってくればインストール完了です。
PS > docker version
関連コンテンツ