Tech Insights
Sithum Meegahapola
May 28, 2019

How to use Windows Docker Containers

How to use Windows Docker Containers

Deploy an Application using Windows Container on Docker (Fix for HotReload on Windows Machine [Angular])

To use docker just go to - https://www.docker.com/get-started anddownload docker for windows.

Then as usual, install them and run it normally. As we know, usuallydeploying with docker creates a Linux container as it is an open sourceapplication. So, first things first.

Change the Container mode to Windows, as below.

Right Click on the Docker icon in taskbar--> Switchto Windows Container

Deploy an Application using Windows Container on Docker (Fix for HotReload on Windows Machine [Angular])

To use docker just go to - https://www.docker.com/get-started anddownload docker for windows.

Then as usual, install them and run it normally. As we know, usuallydeploying with docker creates a Linux container as it is an open sourceapplication. So, first things first.

Change the Container mode to Windows, as below.

Right Click on the Docker icon in taskbar--> Switchto Windows Container

Then it will switch the containers to Windows Containers.

Now we have the Windows Containers up and running instead of Linux containers. For the developers who use windows, this will give full functioning docker to use as the Linux version in Linux OS.

What are the basic changes that need to be done to theDockerfile in our project?

<script src="https://gist.github.com/SithumMeegahapola/9bd2cd905a5061deebb3eaf0d16b4ee0.js"></script>

As shown above, the Dockerfile needs to be changed to windows commands to set the paths etc. And remember to get the base file for windows. “Volumes and Working paths need to be given as shown above, in the manner of full pathin docker file.”

What are the basic changes need to be done in the Docker-Compose.ymlfile?

There is no big difference other than the Volume paths need to be addedas the full path to map as shown earlier in Dockerfile.

As a result of using Docker Windows Containers, all the docker optionsmainly the problem all docker users have which is the “Hot Reload problem” willbe solved in Windows Machines too.

I was working on an angular project running on a Docker container on a Windows machine and it does not give me the hot reload feature. But it was working on the Linux containers on Linux OS. That is the reason why I looked into this matter and finally ended up writing this. So here is how to use Windows Containers on Windows OS. Hope it would help you.

<scriptsrc="https://gist.github.com/SithumMeegahapola/e1f598b450f9b4e1b416375d53fe6227.js"></script>

 

 

Deploy an Application using Windows Container on Docker (Fix for HotReload on Windows Machine [Angular])

To use docker just go to - https://www.docker.com/get-started and download docker for windows.

Then as usual, install them and run it normally. As we know, usually deploying with docker creates a Linux container as it is an open source application. So, first things first.

Change the Container mode to Windows, as below.

Right Click on the Docker icon in taskbar--> Switch to Windows Container

Then it will switch the containers to Windows Containers.

Now we have the Windows Containers up and running instead ofLinux containers. For the developers who use windows, this will give full functioning docker to use as the Linux version in Linux OS.

What are the basic changes that need to be done to theDockerfile in our project?

<script src="https://gist.github.com/SithumMeegahapola/9bd2cd905a5061deebb3eaf0d16b4ee0.js"></script>

As shown above, the Dockerfile needs to be changed to windows commands to set the paths etc. And remember to get the base file for windows. “Volumes and Working paths need to be given as shown above, in the manner of full pathin docker file.”

What are the basic changes need to be done in the Docker-Compose.ymlfile?

There is no big difference other than the Volume paths need to be addedas the full path to map as shown earlier in Dockerfile.

As a result of using Docker Windows Containers, all the docker optionsmainly the problem all docker users have which is the “Hot Reload problem” will be solved in Windows Machines too.

I was working on an angular project running on a Docker container on a Windows machine and it does not give me the hot reload feature. But it wasworking on the Linux containers on Linux OS. That is the reason why I looked into this matter and finally ended up writing this. So here is how to use Windows Containers on Windows OS. Hope it would help you.

<scriptsrc="https://gist.github.com/SithumMeegahapola/e1f598b450f9b4e1b416375d53fe6227.js"></script>

 

 

Then it will switch the containers to Windows Containers.

Now we have the Windows Containers up and running instead of Linux containers. For the developers who use windows, this will give full functioning docker to use as the Linux version in Linux OS.

What are the basic changes that need to be done to theDockerfile in our project?

<script src="https://gist.github.com/SithumMeegahapola/9bd2cd905a5061deebb3eaf0d16b4ee0.js"></script>

As shown above, the Dockerfile needs to be changed to windows commands to set the paths etc. And remember to get the base file for windows. “Volumesand Working paths need to be given as shown above, in the manner of full pathin docker file.”

What are the basic changes need to be done in the Docker-Compose.ymlfile?

There is no big difference other than the Volume paths need to be addedas the full path to map as shown earlier in Dockerfile.

As a result of using Docker Windows Containers, all the docker optionsmainly the problem all docker users have which is the “Hot Reload problem” willbe solved in Windows Machines too.

I was working on an angular project running on a Docker container on aWindows machine and it does not give me the hot reload feature. But it wasworking on the Linux containers on Linux OS. That is the reason why I looked into this matter and finally ended up writing this. So here is how to use Windows Containers on Windows OS. Hope it would help you.

<scriptsrc="https://gist.github.com/SithumMeegahapola/e1f598b450f9b4e1b416375d53fe6227.js"></script>