{"id":2335,"date":"2017-08-09T20:50:52","date_gmt":"2017-08-09T20:50:52","guid":{"rendered":"http:\/\/microsoftgeek.com\/?p=2335"},"modified":"2017-08-09T20:50:52","modified_gmt":"2017-08-09T20:50:52","slug":"how-to-create-a-windows-server-container","status":"publish","type":"post","link":"https:\/\/microsoftgeek.com\/?p=2335","title":{"rendered":"How to Create A Windows Server Container"},"content":{"rendered":"<p>To create a basic Windows Container, I\u2019ll use the docker run command which will create a Windows Nano Server 2016 Container without a specific name. open port or any other customization.<\/p>\n<p>The -it switch will automatically enter you Into the Container terminal<\/p>\n<pre>docker run -it microsoft\/nanoserver<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.ntweekly.com\/wp-content\/uploads\/2017\/06\/060117_0058_HowtoCreate1.png?w=525&amp;ssl=1\" alt=\"\" width=\"524\" height=\"62\" \/><\/p>\n<p>To create a Windows Container with a custom name and port 80 open I\u2019ll use the following command<\/p>\n<pre>docker run -it --name nano1 -p 80:80 microsoft\/nanoserver<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i2.wp.com\/www.ntweekly.com\/wp-content\/uploads\/2017\/06\/060117_0058_HowtoCreate2.png?w=525&amp;ssl=1\" alt=\"\" width=\"524\" height=\"68\" \/><\/p>\n<p>To create Windows Container that will delete itself on exit I\u2019ll use the \u2013rm<\/p>\n<pre>docker run -it --name nano02 --rm microsoft\/nanoserver<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i2.wp.com\/www.ntweekly.com\/wp-content\/uploads\/2017\/06\/060117_0058_HowtoCreate3.png?w=525&amp;ssl=1\" alt=\"\" width=\"524\" height=\"112\" \/><\/p>\n<p>To create a Windows Container with\u00a0Hyper-V Isolation\u00a0I\u2019ll use the command below<\/p>\n<pre>docker run -it --isolation=hyperv microsoft\/nanoserver cmd<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i1.wp.com\/www.ntweekly.com\/wp-content\/uploads\/2017\/06\/060117_0058_HowtoCreate4.png?w=525&amp;ssl=1\" alt=\"\" width=\"524\" height=\"84\" \/><\/p>\n<p>To create a Windows Container and attach it to a storage volume on the Container Host I\u2019ll use the command below<\/p>\n<p>The first two line will create the Data Volume on the host:<\/p>\n<pre>docker volume create data01<\/pre>\n<pre>docker volume ls<\/pre>\n<p>Once the volume Is created I\u2019ll create the Windows Container and attach it to the Volume.<\/p>\n<pre>docker run --name test01 -it -v c:\\programdata\\docker\\volumes\\data01:c:\\data01 microsoft\/nanoserver cmd<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i2.wp.com\/www.ntweekly.com\/wp-content\/uploads\/2017\/06\/060117_0058_HowtoCreate5.png?w=525&amp;ssl=1\" alt=\"\" width=\"524\" height=\"65\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.ntweekly.com\/wp-content\/uploads\/2017\/06\/060117_0058_HowtoCreate6.png?w=525&amp;ssl=1\" alt=\"\" width=\"524\" height=\"42\" \/><\/p>\n<div id=\"jp-relatedposts\" class=\"jp-relatedposts\"><\/div>\n","protected":false},"excerpt":{"rendered":"<p>To create a basic Windows Container, I\u2019ll use the docker run command which will create a Windows Nano Server 2016 Container without a specific name. open port or any other customization. The -it switch will automatically enter you Into the Container terminal docker run -it microsoft\/nanoserver To create a Windows Container with a custom name [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[67,63],"tags":[],"class_list":["post-2335","post","type-post","status-publish","format-standard","hentry","category-windows-containers-containers","category-server-2016-2016"],"_links":{"self":[{"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/posts\/2335","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2335"}],"version-history":[{"count":1,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/posts\/2335\/revisions"}],"predecessor-version":[{"id":2336,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/posts\/2335\/revisions\/2336"}],"wp:attachment":[{"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2335"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2335"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2335"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}