が、Azure VMではなかなか動かず、山市良さんからご助力いただきました、この場をお借りして御礼申し上げます。
まず、
Quick Start – configure a container host
で、PowerShellスクリプトを実行することで、面倒な手順をバイパスできるということを知りました。orz
Azure VMですので、
Scripted - Existing System
に書かれている
wget -uri https://aka.ms/tp5/Install-ContainerHost -OutFile C:\Install-ContainerHost.ps1をそれぞれ実行します。
powershell.exe -NoProfile C:\Install-ContainerHost.ps1
なお、wgetは、PowerShellのエイリアスなので、別途wgetコマンドを導入するは必要はありません(Nano Server除く)。
山市良さんのブログ記事を貼っておきますので参考にしてください。
で、powershell.exe -NoProfile C:\Install-ContainerHost.ps1を実行したのですが、エラーで上手くいきませんでした。

「サービス」からDockerを再起動してみましたが効果無し。


もう一度、powershell.exe -NoProfile C:\Install-ContainerHost.ps1を実行したところ、スクリプトは完了しました。

ですが、docker imagesはエラーで上手くいきませんでした。

山市良さんより下記の手順で再トライをアドバイスいただいたので、実施です。
Install-PackageProvider ContainerImage -Force
Find-ContainerImage
Install-ContainerImage -Name WindowsServerCore
Install-ContainerImage -Name NanoServer
docker images
docker tag "image ID" windowsservercocre:latest
docker tag "image ID" nanoserver:latest

docker imagesを実行したところで、やはりエラー。
ファイルの有無を調べてみましょうということで、見たところ、
C:\ProgramData\docker\tag.txt
が無い!
UNIXならtouchで作るのですが、普通にExplorerで作りました。
それだけではだめで、
net stop docker
net start docker
を実行したところで、ようやく構築がうまく行きました~

しかし、
docker tag "image ID" windowsservercocre:latest
docker tag "image ID" nanoserver:latest
を実行したもののIMAGE IDをテレコにしたため↓

後で実行し直しました。(^^;)
※2016/05/08に画像追加。

ここからは、オンプレミスのWindows Server 2016 TP5でContainer Hostを構築です。
物理ホスト上で構築しても良かったのですが、リトライの可能性を考慮し、Nested Hyper-Vで構築しました。
Windows Server 2016 TP5の英語版を使っていますが、やり方自体はNsted Hyper-Vを試してみたと変わらないので、割愛します。
スクリプトは、Scripted - Existing Systemに書かれている
wget -uri https://aka.ms/tp5/Install-ContainerHost -OutFile C:\Install-ContainerHost.ps1Install-ContainerHost.ps1 の引数に-Hyper-Vがついています~
powershell.exe -NoProfile -ExecutionPolicy Bypass C:\Install-ContainerHost.ps1 -HyperV

と実行自体は、すんなり終わりました。
が、Nano Serverしかイメージがないのですね。。。
Install-PackageProvider ContainerImage -Force
Find-ContainerImage
Install-ContainerImage -Name WindowsServerCore
を再実行してみたものの変化無し。
で、ふと
net stop docker
net start docker
を実行してみたところ、WindowsServerCoreのイメージを認識してくれました。

ということで、
docker tag "image ID" windowsservercocre:latest
を実行して、構築完了です。
PS C:\Windows\system32> docker images
An error occurred trying to connect: Get http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.24/images/json: open //./pipe/docker_engine: The system cannot find the file specified.
が出たら、
C:\ProgramData\docker\runDockerDaemon.cmd
C:\ProgramData\docker\tag.txt
c:\windows\system32\dockerd.exe
の有無をチェック。C:\ProgramData\docker\tag.txtが無い場合は、空のファイルを作っておく。その後、
net stop docker
net start docker
docker imagesでイメージがそろっていない場合は、
net stop docker
net start docker
を実行してみる。
という点が今回のトラブルで勉強となった点です。
0 件のコメント:
コメントを投稿