<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Docker &#8211; Sibeesh Passion</title>
	<atom:link href="https://mail.sibeeshpassion.com/category/docker/feed/" rel="self" type="application/rss+xml" />
	<link>https://mail.sibeeshpassion.com</link>
	<description>My passion towards life</description>
	<lastBuildDate>Wed, 02 Jun 2021 15:18:38 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>/wp-content/uploads/2017/04/Sibeesh_Passion_Logo_Small.png</url>
	<title>Docker &#8211; Sibeesh Passion</title>
	<link>https://mail.sibeeshpassion.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Having a Docker Container as Your Private NPM Registry &#8211; The Easy Way</title>
		<link>https://mail.sibeeshpassion.com/having-a-docker-container-as-your-private-npm-registry-the-easy-way/</link>
					<comments>https://mail.sibeeshpassion.com/having-a-docker-container-as-your-private-npm-registry-the-easy-way/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Sat, 10 Nov 2018 11:43:33 +0000</pubDate>
				<category><![CDATA[Azure]]></category>
		<category><![CDATA[Docker]]></category>
		<category><![CDATA[Docker and NPM Private Registry]]></category>
		<category><![CDATA[Dockerizing]]></category>
		<category><![CDATA[NPM]]></category>
		<category><![CDATA[NPM Registry]]></category>
		<category><![CDATA[Private NPM Registry]]></category>
		<category><![CDATA[Verdaccio]]></category>
		<category><![CDATA[Verdaccio with Docker]]></category>
		<guid isPermaLink="false">https://sibeeshpassion.com/?p=13347</guid>

					<description><![CDATA[[toc] Introduction At some point in our life, we may need almost everything in a private scope, and the same happens with your NPM packages as well. You have created a private NPM package for your company or for yourself and you wanted to host it somewhere, you might have already looked for some options like a paid version of npmjs and many more. But, you were not happy doing it, and somehow you have reached in this article, and I am sure you are expecting something with Docker here. Yes, we are actually going to change our Docker container [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>[toc]</p>
<h2>Introduction</h2>
<p>At some point in our life, we may need almost everything in a private scope, and the same happens with your NPM packages as well. You have created a private NPM package for your company or for yourself and you wanted to host it somewhere, you might have already looked for some options like a paid version of npmjs and many more. But, you were not happy doing it, and somehow you have reached in this article, and I am sure you are expecting something with <a href="https://sibeeshpassion.com/category/docker/">Docker</a> here. Yes, we are actually going to change our Docker container instance to a private NPM registry, and once it is ready you can always host your private npm packages to that registry. If you are not sure of how to create an npm package, please read my Sounds cool? Then, let&#8217;s jump into it. I hope you will find this post useful.</p>
<h2>Background</h2>
<p>As I mentioned before, I am going to create a Container Instance and will be changing it to a private NPM registry. I will be using <a href="https://sibeeshpassion.com/category/azure/">Microsoft Azure</a>, if you don&#8217;t have a valid Azure subscription, I strongly recommend you to create one.</p>
<h2>Setting up a Docker Private NPM Registry</h2>
<p>Once you get the Azure subscription, you can start the setups.</p>
<h3>Creating Azure Container Registry</h3>
<p>Do you have a GitHub account? Do you know what we can do with a Github account? Yes, we can upload our projects/source codes there and we can do versioning, we can create branches and many more. You can consider that the Azure Container Registry is a similar service to that. An Azure Container Registry or ACR is a private Docker registry where you can easily manage all of your Docker container images in the same place. Isn&#8217;t that cool? According to Microsoft, you can use Azure Container Registry to:</p>
<ul>
<li>Store and manage container images across all types of Azure deployments</li>
<li>Use familiar, open-source Docker command line interface (CLI) tools</li>
<li>Keep container images near deployments to reduce latency and costs</li>
<li>Simplify registry access management with Azure Active Directory</li>
<li>Maintain Windows and Linux container images in a single Docker registry</li>
</ul>
<p>To create the Azure Container Registry, you should have a valid Azure subscription. If you don&#8217;t have one, please get one, that will help you follow this article.</p>
<p>Once you logged in to the Portal. You can click on the + icon, Create a resource, and search for the Container Registry.</p>
<div id="attachment_13349" style="width: 644px" class="wp-caption aligncenter"><a href="https://sibeeshpassion.com/wp-content/uploads/2018/11/Search-Container-Registry-e1541839869109.png"><img fetchpriority="high" decoding="async" aria-describedby="caption-attachment-13349" class="size-full wp-image-13349" src="https://sibeeshpassion.com/wp-content/uploads/2018/11/Search-Container-Registry-e1541839869109.png" alt="Search Container Registry" width="634" height="304" /></a><p id="caption-attachment-13349" class="wp-caption-text">Search Container Registry</p></div>
<p>When you click the Container Registry, you will be asked to give the details as shown in the preceding image.</p>
<div id="attachment_13350" style="width: 310px" class="wp-caption aligncenter"><a href="https://sibeeshpassion.com/wp-content/uploads/2018/11/Container-Registry-Details.png"><img decoding="async" aria-describedby="caption-attachment-13350" class="wp-image-13350" src="https://sibeeshpassion.com/wp-content/uploads/2018/11/Container-Registry-Details-225x300.png" alt="Container Registry Details" width="300" height="400" srcset="/wp-content/uploads/2018/11/Container-Registry-Details-225x300.png 225w, /wp-content/uploads/2018/11/Container-Registry-Details-400x533.png 400w, /wp-content/uploads/2018/11/Container-Registry-Details-450x600.png 450w, /wp-content/uploads/2018/11/Container-Registry-Details.png 558w" sizes="(max-width: 300px) 100vw, 300px" /></a><p id="caption-attachment-13350" class="wp-caption-text">Container Registry Details</p></div>
<p>Please remember to enable the Admin user, as you will be able to use the registry name as username and admin user access key as the password to docker login to your container registry only if it is enabled. I will explain the same in the coming section.</p>
<p>Once you create your Container Registry, you will be given a login server as yourregistryname.azurecr.io. You can always see other information in the overview section. If you click on the Access Keys link under the settings, you can see the username and the password for your Container Registry. Remember we have enabled the Admin User property while creating the Container Registry?</p>
<div id="attachment_13351" style="width: 463px" class="wp-caption aligncenter"><a href="https://sibeeshpassion.com/wp-content/uploads/2018/11/Container-Registry-Settings.png"><img decoding="async" aria-describedby="caption-attachment-13351" class="size-full wp-image-13351" src="https://sibeeshpassion.com/wp-content/uploads/2018/11/Container-Registry-Settings.png" alt="Container Registry Settings" width="453" height="662" srcset="/wp-content/uploads/2018/11/Container-Registry-Settings.png 453w, /wp-content/uploads/2018/11/Container-Registry-Settings-205x300.png 205w, /wp-content/uploads/2018/11/Container-Registry-Settings-400x585.png 400w, /wp-content/uploads/2018/11/Container-Registry-Settings-411x600.png 411w" sizes="(max-width: 453px) 100vw, 453px" /></a><p id="caption-attachment-13351" class="wp-caption-text">Container Registry Settings</p></div>
<div class="fxc-base azc-control azc-editableControl azc-validatableControl azc-itemList azc-optionPicker azc-validation-border azc-noRadio azc-validatableControl-valid-validated azc-is-edited" data-control="true" data-editable="true" data-canfocus="true"></div>
<div data-control="true" data-editable="true" data-canfocus="true">Please be noted that the registry name and the admin username is same.</div>
<h3 data-control="true" data-editable="true" data-canfocus="true">Creating a Docker Container in Local</h3>
<div data-control="true" data-editable="true" data-canfocus="true">To do this step, you should download and install Docker in your machine. Once it is installed, please make sure that the docker is running in your machine. If yes, let&#8217;s go ahead and start some amazing things together. Let&#8217;s just try Docker version command first to make sure that it is working.</div>
<div data-control="true" data-editable="true" data-canfocus="true"></div>
<div data-control="true" data-editable="true" data-canfocus="true">
<div id="attachment_13352" style="width: 666px" class="wp-caption aligncenter"><a href="https://sibeeshpassion.com/wp-content/uploads/2018/11/Docker-version.png"><img decoding="async" aria-describedby="caption-attachment-13352" class="size-full wp-image-13352" src="https://sibeeshpassion.com/wp-content/uploads/2018/11/Docker-version.png" alt="Docker version" width="656" height="102" srcset="/wp-content/uploads/2018/11/Docker-version.png 656w, /wp-content/uploads/2018/11/Docker-version-300x47.png 300w, /wp-content/uploads/2018/11/Docker-version-400x62.png 400w" sizes="(max-width: 656px) 100vw, 656px" /></a><p id="caption-attachment-13352" class="wp-caption-text">Docker version</p></div>
</div>
<div data-control="true" data-editable="true" data-canfocus="true"></div>
<div data-control="true" data-editable="true" data-canfocus="true">Cool, the docker is working fine. Now we can start creating a local NPM registry. To do so I am going to pull a package from Docker hub, which is nothing but Verdaccio.</div>
<div data-control="true" data-editable="true" data-canfocus="true"></div>
<div data-control="true" data-editable="true" data-canfocus="true">Verdaccio is a private npm proxy registry which is built on top of Node.js. According to the Verdaccio documentation,</div>
<div data-control="true" data-editable="true" data-canfocus="true">
<ul>
<li>It&#8217;s a web app based on Node.js</li>
<li>It&#8217;s a private npm registry</li>
<li>It&#8217;s a local network proxy</li>
<li>It&#8217;s a Pluggable application</li>
<li>It&#8217;s a fairly easy install and use</li>
<li>It is 100% compatible with yarn, npm, and pnpm</li>
<li>It was <strong>forked</strong> based on and<code>sinopia@1.4.0</code> 100% <strong>backward compatible</strong>.</li>
</ul>
<p>Let&#8217;s pull the image of Verdaccio now.</p>
<pre class="EnlighterJSRAW" data-enlighter-language="null">docker pull verdaccio/verdaccio</pre>
<p>Once you have done that, try to run &#8220;docker images&#8221;  you should be able to see your Verdaccio image.</p>
</div>
<pre class="EnlighterJSRAW" data-enlighter-language="null">verdaccio/verdaccio           latest              c542d9e516e4        3 weeks ago         659MB</pre>
<p>It may take a few minutes to pull the entire image. As I have already pulled the latest image, it will be quick for me and get the output as below.</p>
<div id="attachment_13353" style="width: 644px" class="wp-caption aligncenter"><a href="https://sibeeshpassion.com/wp-content/uploads/2018/11/Docker-pull-verdaccio.png"><img decoding="async" aria-describedby="caption-attachment-13353" class="wp-image-13353 size-full" src="https://sibeeshpassion.com/wp-content/uploads/2018/11/Docker-pull-verdaccio-e1541843418760.png" alt="Docker pull verdaccio" width="634" height="91" /></a><p id="caption-attachment-13353" class="wp-caption-text">Docker pull verdaccio</p></div>
<p>You can also tag the version you need, just in case.</p>
<pre class="EnlighterJSRAW" data-enlighter-language="null">docker pull verdaccio/verdaccio:3</pre>
<p>Now it is time to run the Verdaccio, are you ready?</p>
<pre class="EnlighterJSRAW" data-enlighter-language="null">docker run -it --rm --name verdaccio -p 4873:4873 verdaccio/verdaccio</pre>
<p>The last argument is our image name, if you don&#8217;t have such an image in your local, the same will be pulled from the Docker hub. As you might have noticed already we are using the port 4873, and the same will be mapped to the container instance port later when we create the container instance. Now please make sure that you are getting an output as preceding.</p>
<div id="attachment_13354" style="width: 644px" class="wp-caption aligncenter"><a href="https://sibeeshpassion.com/wp-content/uploads/2018/11/Verdaccio-docker-run.png"><img decoding="async" aria-describedby="caption-attachment-13354" class="wp-image-13354 size-full" src="https://sibeeshpassion.com/wp-content/uploads/2018/11/Verdaccio-docker-run-e1541844369136.png" alt="Verdaccio docker run" width="634" height="90" /></a><p id="caption-attachment-13354" class="wp-caption-text">Verdaccio docker run</p></div>
<p>You should now be able to go into http://localhost:4873 and see that verdaccio is running successfully.</p>
<h3>Pushing Local Container to Azure Container Registry</h3>
<p>Now that we have an Azure Container Registry running and a local container which can act as a private NPM registry. What are we waiting for? Let&#8217;s just push this to our ACR. Before that, we need to login to our Azure Container Registry server.</p>
<pre class="EnlighterJSRAW" data-enlighter-language="null">docker login sibeeshpassion.azurecr.io</pre>
<p>Once you run the above command with the correct credential, you will be able to see the output as below.</p>
<div id="attachment_13355" style="width: 644px" class="wp-caption aligncenter"><a href="https://sibeeshpassion.com/wp-content/uploads/2018/11/Docker-login-Azure-container-registry.png"><img decoding="async" aria-describedby="caption-attachment-13355" class="wp-image-13355 size-full" src="https://sibeeshpassion.com/wp-content/uploads/2018/11/Docker-login-Azure-container-registry-e1541845257194.png" alt="Docker login Azure container registry" width="634" height="97" /></a><p id="caption-attachment-13355" class="wp-caption-text">Docker login Azure container registry</p></div>
<p>Now let&#8217;s just tag our image, as this will help to manage our images easily in the Container Registry.</p>
<pre class="EnlighterJSRAW" data-enlighter-language="null">docker tag &lt;image name&gt; &lt;login server&gt;/&lt;repository name&gt;/&lt;name&gt;:v1
</pre>
<p>For example, I used this command as below.</p>
<pre class="EnlighterJSRAW" data-enlighter-language="null">docker tag verdaccio/verdaccio sibeeshpassion.azurecr.io/verdaccio/verdaccio:v1</pre>
<p>Let&#8217;s push our image to the Container Registry now.</p>
<pre class="EnlighterJSRAW" data-enlighter-language="null">docker push sibeeshpassion.azurecr.io/verdaccio/verdaccio:v1</pre>
<p>If everything goes well, you must see an output as preceding.</p>
<div id="attachment_13356" style="width: 644px" class="wp-caption aligncenter"><a href="https://sibeeshpassion.com/wp-content/uploads/2018/11/Pushing-to-Container-Registry.png"><img decoding="async" aria-describedby="caption-attachment-13356" class="wp-image-13356 size-full" src="https://sibeeshpassion.com/wp-content/uploads/2018/11/Pushing-to-Container-Registry-e1541846656271.png" alt="Pushing to Container Registry" width="634" height="191" /></a><p id="caption-attachment-13356" class="wp-caption-text">Pushing to Container Registry</p></div>
<p>Now, you can log in to your Azure portal and check the repositories of your Azure Container Registry. You should be able to see your image with the tag we have provided.</p>
<div id="attachment_13358" style="width: 644px" class="wp-caption aligncenter"><a href="https://sibeeshpassion.com/wp-content/uploads/2018/11/Repository-in-Azure-Container-Registry.png"><img decoding="async" aria-describedby="caption-attachment-13358" class="size-full wp-image-13358" src="https://sibeeshpassion.com/wp-content/uploads/2018/11/Repository-in-Azure-Container-Registry.png" alt="Repository in Azure Container Registry" width="634" height="404" srcset="/wp-content/uploads/2018/11/Repository-in-Azure-Container-Registry.png 634w, /wp-content/uploads/2018/11/Repository-in-Azure-Container-Registry-300x191.png 300w, /wp-content/uploads/2018/11/Repository-in-Azure-Container-Registry-400x255.png 400w" sizes="(max-width: 634px) 100vw, 634px" /></a><p id="caption-attachment-13358" class="wp-caption-text">Repository in Azure Container Registry</p></div>
<h3>Creating a Container Instance</h3>
<p>Now, we have a valid Container Registry which can act as a private NPM registry and is that enough? N,o it is not, we are not finished yet. We need a place where this registry can run. Well, Azure has everything we need, we are going to create a Container Instance for this purpose. A container instance is a simplest and fastest way to run a single container. While creating the Container Instance, you will have to go through 3 steps.</p>
<ol>
<li>Configure the basic settings</li>
<li>Specify container requirements</li>
<li>Container instance</li>
</ol>
<h4>Configure Basic Settings</h4>
<p>You can configure the settings as per your needs, I have configured mine as below.</p>
<div id="attachment_13359" style="width: 583px" class="wp-caption aligncenter"><a href="https://sibeeshpassion.com/wp-content/uploads/2018/11/Container-Instance-Basic-Settings.png"><img decoding="async" aria-describedby="caption-attachment-13359" class="size-full wp-image-13359" src="https://sibeeshpassion.com/wp-content/uploads/2018/11/Container-Instance-Basic-Settings.png" alt="Container Instance Basic Settings" width="573" height="1075" srcset="/wp-content/uploads/2018/11/Container-Instance-Basic-Settings.png 573w, /wp-content/uploads/2018/11/Container-Instance-Basic-Settings-160x300.png 160w, /wp-content/uploads/2018/11/Container-Instance-Basic-Settings-546x1024.png 546w, /wp-content/uploads/2018/11/Container-Instance-Basic-Settings-400x750.png 400w, /wp-content/uploads/2018/11/Container-Instance-Basic-Settings-320x600.png 320w" sizes="(max-width: 573px) 100vw, 573px" /></a><p id="caption-attachment-13359" class="wp-caption-text">Container Instance Basic Settings</p></div>
<p>Please be noted that I have given the container image type as Private.</p>
<h4>Specify Container Requirements</h4>
<p>Here in this step, I am going to select the Public IP address as &#8220;Yes&#8221;, so that I can set the DNS label while configuring. And I will also set the port as 4873.</p>
<div id="attachment_13360" style="width: 534px" class="wp-caption aligncenter"><a href="https://sibeeshpassion.com/wp-content/uploads/2018/11/Network-Settings-in-Azure-Container-Instance.png"><img decoding="async" aria-describedby="caption-attachment-13360" class="size-full wp-image-13360" src="https://sibeeshpassion.com/wp-content/uploads/2018/11/Network-Settings-in-Azure-Container-Instance.png" alt="Network Settings in Azure Container Instance" width="524" height="402" srcset="/wp-content/uploads/2018/11/Network-Settings-in-Azure-Container-Instance.png 524w, /wp-content/uploads/2018/11/Network-Settings-in-Azure-Container-Instance-300x230.png 300w, /wp-content/uploads/2018/11/Network-Settings-in-Azure-Container-Instance-400x307.png 400w" sizes="(max-width: 524px) 100vw, 524px" /></a><p id="caption-attachment-13360" class="wp-caption-text">Network Settings in Azure Container Instance</p></div>
<h4>Container Instance</h4>
<p>In this step, you can verify all of your settings, and in the background, Azure will validate the settings and if it is valid, the OK button will be enabled, click OK once it is enabled. It may take some time to build your resource and once it is done you can always go to the overview of your Container Instance and run it with the port 4873. For example, I can see my container in this URL http://sibeeshpassion.westeurope.azurecontainer.io:4873/#/.</p>
<h2>Pushing Your Own Private NPM Package to Docker Private NPM Registry</h2>
<p>Wow!, we have a private Docker NPM registry now. Let&#8217;s just try to push our private NPM package to this registry now. I have created my own NPM package a few days back, if you want to know how, you can always read this article: <a href="https://medium.com/@sibeeshvenu/create-your-own-npm-package-private-or-public-60edc2c42f68">Create Your Own NPM Package — Private or Public</a>. I will open my package in the vscode.</p>
<p>Let&#8217;s add the user before we publish the package.</p>
<pre class="EnlighterJSRAW" data-enlighter-language="null">npm adduser --registry=http://sibeeshpassion.westeurope.azurecontainer.io:4873/#/</pre>
<p>The above command will ask you for the username and password.</p>
<div id="attachment_13361" style="width: 644px" class="wp-caption aligncenter"><a href="https://sibeeshpassion.com/wp-content/uploads/2018/11/NPM-Publish-with-Private-Registry-AddUser.png"><img decoding="async" aria-describedby="caption-attachment-13361" class="size-full wp-image-13361" src="https://sibeeshpassion.com/wp-content/uploads/2018/11/NPM-Publish-with-Private-Registry-AddUser.png" alt="NPM Publish with Private Registry AddUser" width="634" height="140" srcset="/wp-content/uploads/2018/11/NPM-Publish-with-Private-Registry-AddUser.png 634w, /wp-content/uploads/2018/11/NPM-Publish-with-Private-Registry-AddUser-300x66.png 300w, /wp-content/uploads/2018/11/NPM-Publish-with-Private-Registry-AddUser-400x88.png 400w" sizes="(max-width: 634px) 100vw, 634px" /></a><p id="caption-attachment-13361" class="wp-caption-text">NPM Publish with Private Registry AddUser</p></div>
<p>Now we can run our publish command.</p>
<pre class="EnlighterJSRAW" data-enlighter-language="null">npm publish dist --registry=http://sibeeshpassion.westeurope.azurecontainer.io:4873/#/</pre>
<p>You can get an output as preceding if the publishing is successful.</p>
<pre class="EnlighterJSRAW" data-enlighter-language="null">npm notice === Tarball Details ===
npm notice name:          org-npm-package
npm notice version:       1.1.1
npm notice package size:  7.8 kB
npm notice unpacked size: 37.9 kB
npm notice shasum:        f1d8e033bb6d2545502802510258cf9f8bcc9ab3
npm notice integrity:     sha512-3MuplP75D0gpj[...]Z5KFo0DNbzGFw==
npm notice total files:   22
npm notice
+ org-npm-package@1.1.1</pre>
<p>What are you waiting for, just go and see your package in your Docker, I was eagerly waiting for this moment, and I am going to see my package by hitting my container here http://sibeeshpassion.westeurope.azurecontainer.io:4873/#/detail/org-npm-package.</p>
<h2>Using Your Private Package from the Docker Private NPM Registry</h2>
<p>Just run the below command and your private package will be pulled from your private Docker NPM registry.</p>
<pre class="EnlighterJSRAW" data-enlighter-language="null">npm install org-npm-package --registry=http://sibeeshpassion.westeurope.azurecontainer.io:4873</pre>
<h2><span id="conclusion_1"><span id="conclusion">Conclusion</span></span></h2>
<p>Congratulation, we have successfully created a Docker Private NPM Registry, go ahead and create as many private packages you wish and move those to your Private NPM registry. Thanks a lot for following/reading this article. I really appreciate your time and effort.  In this article, we have learned how to,</p>
<ol>
<li>Create an Azure Container Registry</li>
<li>Create a Local Docker Container</li>
<li>Create Verdaccio image and run it in a local docker container</li>
<li>Push the local Verdaccio image to the Azure Container Registry</li>
<li>Set up the Docker Container Instance using the Azure Container Registry</li>
<li>Pushing the NPM package to the Private Docker NPM registry</li>
<li>Pulling the package from the Private registry</li>
</ol>
<h2><span id="your-turn-what-do-you-think">Your turn. What do you think?</span></h2>
<p>Thanks a lot for reading. I will come back with another post on the same topic very soon. Did I miss anything that you may think which is needed? Could you find this post as useful? Kindly do not forget to share me your feedback.</p>
<p>Kindest Regards<br />
Sibeesh Venu</p>
]]></content:encoded>
					
					<wfw:commentRss>https://mail.sibeeshpassion.com/having-a-docker-container-as-your-private-npm-registry-the-easy-way/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Installing Asp.Net Core Docker For Windows</title>
		<link>https://mail.sibeeshpassion.com/installing-asp-net-core-docker-for-windows/</link>
					<comments>https://mail.sibeeshpassion.com/installing-asp-net-core-docker-for-windows/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Sun, 07 May 2017 11:01:29 +0000</pubDate>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Asp.Net Core]]></category>
		<category><![CDATA[Docker]]></category>
		<category><![CDATA[Asp.Net Core Docker]]></category>
		<category><![CDATA[Docker In Windows]]></category>
		<guid isPermaLink="false">http://sibeecst_passion.com/?p=12284</guid>

					<description><![CDATA[[toc] Introduction Here, in this post we are going to a see how we can install Asp.Net Core Docker in our Windows. Before we start, it would be useful if we say something about the Docker right? Docker is a container software platform where container is everything we need to make our software run. The container is light in weight. You can read more about the Docker here. I hope you will like this. Now let&#8217;s begin. Background Today, I was just trying to create a Asp.Net Docker application in Visual Studio 2017. Unfortunately I was getting an error as preceding. [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>[toc]</p>
<h3>Introduction</h3>
<p>Here, in this post we are going to a see how we can install Asp.Net Core Docker in our <a href="http://sibeeshpassion.com/category/Windows-10/" target="_blank" rel="noopener noreferrer">Windows</a>. Before we start, it would be useful if we say something about the Docker right? Docker is a container software platform where container is everything we need to make our software run. The container is light in weight. You can read more about the Docker <a href="https://www.docker.com/what-docker">here</a>. I hope you will like this. Now let&#8217;s begin.</p>
<h3>Background</h3>
<p>Today, I was just trying to create a Asp.Net Docker application in <a href="http://sibeeshpassion.com/category/Visual-Studio-2017/">Visual Studio 2017</a>. Unfortunately I was getting an error as preceding.</p>
<blockquote><p>Error MSB4018 The &#8220;PrepareForBuild&#8221; task failed unexpectedly.<br />
Microsoft.DotNet.Docker.CommandLineClientException: Unable to run &#8216;docker-compose&#8217;. Verify that Docker for Windows is installed and running locally. For troubleshooting, please review http://aka.ms/DockerToolsTroubleshooting. &#8212;&gt; System.ComponentModel.Win32Exception: The system cannot find the file specified</p></blockquote>
<p>Then I came to know that I have not installed Docker in my machine yet, so I decided to do that.</p>
<div id="attachment_12307" style="width: 644px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2017/05/Asp-Net-Core-Docker-Error.png"><img decoding="async" aria-describedby="caption-attachment-12307" class="wp-image-12307" src="http://sibeeshpassion.com/wp-content/uploads/2017/05/Asp-Net-Core-Docker-Error-1024x581.png" alt="Asp Net Core Docker Error" width="634" height="360" srcset="/wp-content/uploads/2017/05/Asp-Net-Core-Docker-Error-1024x581.png 1024w, /wp-content/uploads/2017/05/Asp-Net-Core-Docker-Error-300x170.png 300w, /wp-content/uploads/2017/05/Asp-Net-Core-Docker-Error-768x436.png 768w, /wp-content/uploads/2017/05/Asp-Net-Core-Docker-Error-400x227.png 400w, /wp-content/uploads/2017/05/Asp-Net-Core-Docker-Error-1057x600.png 1057w, /wp-content/uploads/2017/05/Asp-Net-Core-Docker-Error.png 1379w" sizes="(max-width: 634px) 100vw, 634px" /></a><p id="caption-attachment-12307" class="wp-caption-text">Asp Net Core Docker Error</p></div>
<h3>Installing Docker For Windows</h3>
<p>You can install the Docker from <a href="https://docs.docker.com/docker-for-windows/install/#download-docker-for-windows">here</a>. Once you downloaded the set up file, please run the file.</p>
<div id="attachment_12308" style="width: 628px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2017/05/Docker-For-Windows.png"><img decoding="async" aria-describedby="caption-attachment-12308" class="size-full wp-image-12308" src="http://sibeeshpassion.com/wp-content/uploads/2017/05/Docker-For-Windows.png" alt="Docker For Windows" width="618" height="483" srcset="/wp-content/uploads/2017/05/Docker-For-Windows.png 618w, /wp-content/uploads/2017/05/Docker-For-Windows-300x234.png 300w, /wp-content/uploads/2017/05/Docker-For-Windows-400x313.png 400w" sizes="(max-width: 618px) 100vw, 618px" /></a><p id="caption-attachment-12308" class="wp-caption-text">Docker For Windows</p></div>
<h3>Start and test the Docker</h3>
<p>Once you installed the Docker, now it is time to test whether everything is installed correctly or not. Before that make sure that the Docker is starting.</p>
<div id="attachment_12309" style="width: 281px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2017/05/Docker-is-Starting.png"><img decoding="async" aria-describedby="caption-attachment-12309" class="size-full wp-image-12309" src="http://sibeeshpassion.com/wp-content/uploads/2017/05/Docker-is-Starting.png" alt="Docker is Starting" width="271" height="152" /></a><p id="caption-attachment-12309" class="wp-caption-text">Docker is Starting</p></div>
<p>There is a hight possibility that to get an error &#8220;Hardware assisted virtulization and data execution protection must be enabled in the BIOS&#8221; as preceding image.</p>
<div id="attachment_12310" style="width: 644px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2017/05/Docker-Error.png"><img decoding="async" aria-describedby="caption-attachment-12310" class="wp-image-12310" src="http://sibeeshpassion.com/wp-content/uploads/2017/05/Docker-Error.png" alt="Docker Error" width="634" height="233" srcset="/wp-content/uploads/2017/05/Docker-Error.png 863w, /wp-content/uploads/2017/05/Docker-Error-300x110.png 300w, /wp-content/uploads/2017/05/Docker-Error-768x282.png 768w, /wp-content/uploads/2017/05/Docker-Error-400x147.png 400w" sizes="(max-width: 634px) 100vw, 634px" /></a><p id="caption-attachment-12310" class="wp-caption-text">Docker Error</p></div>
<p>Before you go and change the settings in BIOS, check in Task Manager window as well.</p>
<div id="attachment_12311" style="width: 644px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2017/05/Hyper-V-support-and-Virtulization.png"><img decoding="async" aria-describedby="caption-attachment-12311" class="wp-image-12311" src="http://sibeeshpassion.com/wp-content/uploads/2017/05/Hyper-V-support-and-Virtulization.png" alt="Hyper V support and Virtulization" width="634" height="564" srcset="/wp-content/uploads/2017/05/Hyper-V-support-and-Virtulization.png 834w, /wp-content/uploads/2017/05/Hyper-V-support-and-Virtulization-300x267.png 300w, /wp-content/uploads/2017/05/Hyper-V-support-and-Virtulization-768x683.png 768w, /wp-content/uploads/2017/05/Hyper-V-support-and-Virtulization-400x356.png 400w, /wp-content/uploads/2017/05/Hyper-V-support-and-Virtulization-674x600.png 674w" sizes="(max-width: 634px) 100vw, 634px" /></a><p id="caption-attachment-12311" class="wp-caption-text">Hyper V support and Virtulization</p></div>
<h3>Enabling Virtulization in BIOS</h3>
<p>To Enable the Virtulization in BIOS, go to System Configuration -&gt; Click on Virtulization Technology and Enable it.</p>
<div id="attachment_12313" style="width: 644px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2017/05/BIOS-Settings.jpeg"><img decoding="async" aria-describedby="caption-attachment-12313" class="wp-image-12313" src="http://sibeeshpassion.com/wp-content/uploads/2017/05/BIOS-Settings-1024x574.jpeg" alt="BIOS Settings" width="634" height="355" srcset="/wp-content/uploads/2017/05/BIOS-Settings-1024x574.jpeg 1024w, /wp-content/uploads/2017/05/BIOS-Settings-300x168.jpeg 300w, /wp-content/uploads/2017/05/BIOS-Settings-768x430.jpeg 768w, /wp-content/uploads/2017/05/BIOS-Settings-400x224.jpeg 400w, /wp-content/uploads/2017/05/BIOS-Settings-1071x600.jpeg 1071w, /wp-content/uploads/2017/05/BIOS-Settings.jpeg 634w" sizes="(max-width: 634px) 100vw, 634px" /></a><p id="caption-attachment-12313" class="wp-caption-text">BIOS Settings</p></div>
<p>After the restart, the Docker will ask you to start the service. Go ahead and do that.</p>
<h3>Setting up Docker</h3>
<div id="attachment_12314" style="width: 644px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2017/05/Docker-Service-Is-Not-Runnig-Window.png"><img decoding="async" aria-describedby="caption-attachment-12314" class="wp-image-12314" src="http://sibeeshpassion.com/wp-content/uploads/2017/05/Docker-Service-Is-Not-Runnig-Window.png" alt="Docker Service Is Not Runnig Window" width="634" height="233" srcset="/wp-content/uploads/2017/05/Docker-Service-Is-Not-Runnig-Window.png 863w, /wp-content/uploads/2017/05/Docker-Service-Is-Not-Runnig-Window-300x110.png 300w, /wp-content/uploads/2017/05/Docker-Service-Is-Not-Runnig-Window-768x282.png 768w, /wp-content/uploads/2017/05/Docker-Service-Is-Not-Runnig-Window-400x147.png 400w" sizes="(max-width: 634px) 100vw, 634px" /></a><p id="caption-attachment-12314" class="wp-caption-text">Docker Service Is Not Runnig Window</p></div>
<p>Now again, if you are getting an error as &#8220;Error MSB4018 The &#8220;PrepareForLaunch&#8221; task failed unexpectedly.<br />
Microsoft.DotNet.Docker.CommandLineClientException: Creating network &#8220;dockercompose3875147227_default&#8221; with the default driver<br />
Building linq_basic_to_advanced Service  &#8216;linq_basic_to_advanced&#8217; failed to build: Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers).&#8221;, you need to change your shared drive settings in Docker.</p>
<p>Right click and click on the settings.</p>
<div id="attachment_12315" style="width: 397px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2017/05/Docker-Settings.png"><img decoding="async" aria-describedby="caption-attachment-12315" class="size-full wp-image-12315" src="http://sibeeshpassion.com/wp-content/uploads/2017/05/Docker-Settings.png" alt="Docker Settings" width="387" height="291" srcset="/wp-content/uploads/2017/05/Docker-Settings.png 387w, /wp-content/uploads/2017/05/Docker-Settings-300x226.png 300w" sizes="(max-width: 387px) 100vw, 387px" /></a><p id="caption-attachment-12315" class="wp-caption-text">Docker Settings</p></div>
<p>Click on the Shared Drives and  select the drive that hosts your project and the drive where %USERPROFILE% resides.</p>
<div id="attachment_12316" style="width: 644px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2017/05/Shared-Drive-in-Docker.png"><img decoding="async" aria-describedby="caption-attachment-12316" class="wp-image-12316" src="http://sibeeshpassion.com/wp-content/uploads/2017/05/Shared-Drive-in-Docker-1024x666.png" alt="Shared Drive in Docker" width="634" height="413" srcset="/wp-content/uploads/2017/05/Shared-Drive-in-Docker-1024x666.png 1024w, /wp-content/uploads/2017/05/Shared-Drive-in-Docker-300x195.png 300w, /wp-content/uploads/2017/05/Shared-Drive-in-Docker-768x500.png 768w, /wp-content/uploads/2017/05/Shared-Drive-in-Docker-400x260.png 400w, /wp-content/uploads/2017/05/Shared-Drive-in-Docker-922x600.png 922w, /wp-content/uploads/2017/05/Shared-Drive-in-Docker.png 549w" sizes="(max-width: 634px) 100vw, 634px" /></a><p id="caption-attachment-12316" class="wp-caption-text">Shared Drive in Docker</p></div>
<p>Click on Apply and type your filesystem passwor in the following pop up. Now if you are running the Edge version of Docker Community Edition for Windows, after the install you may be able to login with your Docker ID and password.</p>
<div id="attachment_12320" style="width: 619px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2017/05/Docker-SignIn-page.png"><img decoding="async" aria-describedby="caption-attachment-12320" class="size-full wp-image-12320" src="http://sibeeshpassion.com/wp-content/uploads/2017/05/Docker-SignIn-page.png" alt="Docker SignIn page" width="609" height="367" srcset="/wp-content/uploads/2017/05/Docker-SignIn-page.png 609w, /wp-content/uploads/2017/05/Docker-SignIn-page-300x181.png 300w, /wp-content/uploads/2017/05/Docker-SignIn-page-400x241.png 400w" sizes="(max-width: 609px) 100vw, 609px" /></a><p id="caption-attachment-12320" class="wp-caption-text">Docker SignIn page</p></div>
<p>We have enough settings for now, shall we just check whether the installation is done perfectly or not? To check, go to the command window and type the command as  docker run hello-world.</p>
<div id="attachment_12322" style="width: 593px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2017/05/Docker-Check-From-Command-Window.png"><img decoding="async" aria-describedby="caption-attachment-12322" class="size-full wp-image-12322" src="http://sibeeshpassion.com/wp-content/uploads/2017/05/Docker-Check-From-Command-Window.png" alt="Docker Check From Command Window" width="583" height="414" srcset="/wp-content/uploads/2017/05/Docker-Check-From-Command-Window.png 583w, /wp-content/uploads/2017/05/Docker-Check-From-Command-Window-300x213.png 300w, /wp-content/uploads/2017/05/Docker-Check-From-Command-Window-400x284.png 400w" sizes="(max-width: 583px) 100vw, 583px" /></a><p id="caption-attachment-12322" class="wp-caption-text">Docker Check From Command Window</p></div>
<p>You can also check the Docker version with the command docker &#8211;version</p>
<h3>Conclusion</h3>
<p>Did I miss anything that you may think which is needed? Could you find this post as useful? I hope you liked this article. Please share me your valuable suggestions and feedback.</p>
<h3>Your turn. What do you think?</h3>
<p>A blog isn’t a blog without comments, but do try to stay on topic. If you have a question unrelated to this post, you’re better off posting it on C# Corner, Code Project, Stack Overflow, Asp.Net Forum instead of commenting here. Tweet or email me a link to your question there and I’ll definitely try to help if I can.</p>
<p>Kindest Regards<br />
Sibeesh Venu</p>
]]></content:encoded>
					
					<wfw:commentRss>https://mail.sibeeshpassion.com/installing-asp-net-core-docker-for-windows/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
	</channel>
</rss>
