Powershellを使ってWindowsコンテナをインストールする方法を解説します。
Windowsコンテナは、Windows Serverでのみ使用可能です。
コンテナ機能のインストール
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 xx.xx.xx DockerDefault Contains Docker EE for use with Windows Server.
# 再起動
PS C:\Users\Administrator> Restart-Computer -Force
# バージョンの確認
PS C:\Users\Administrator> docker version
サービス上では「Docker Engine」が該当します。
TIPS
Windowsコンテナを使ってWebサイト・CGIを構築する方法はこちらをご覧下さい。
コメント