Change Docker Image Location on Windows


By default Docker sets up MobyLinuxVM and downloads and installs docker image on your C:\ drive. For most people this is not ideal, as this is our main application drive and can be limited in space. Especially if you are using Docker on a laptop with a small hard drive. So you will probably want to use an different drive to your C:\ drive.

It is a very straight forward task to perform.

First of all, you need to stop your docker containers using the docker stop [Container Name] command. For a list of all your docker images, run the command: docker images –all.

Then type “Hyper-V Manager in the taskbar search box and run it. Select your PC in the left hand pane. Right-click on the correct virtual machine which by default is called MobyLinuxVM. Select “Turn Off”. Right-click on the Virtual Machine and select “Move”. Follow the on-screen prompts to move your VM.

Now open Docker Settings and select Daemon. Switch from Basic to Advanced. Edit the JSON so that it looks like:

{
“registry-mirrors”: [],
“insecure-registries”: [],
“debug”: true,
“experimental”: false,
“graph”: “G:\\DockerImages”
}

Click on Apply to apply your change. In the JSON above, the graph property is the location where your docker images will be placed by default from now on.

51GYZtbe1sL._SX404_BO1204203200_If you are new to Docker and would like to learn more on how to use Docker on Windows then you can buy the book Docker on Windows published by Packt.

Author Elton Stoneman guides you through getting started with docker on Windows, packaging and running applications as docker containers, developing dockerised .NET and .NET Core Applications, pushing and pulling images from docker registries, adopting container-first solution design, organising distributed solutions with Docker Compose, administering and monitoring dockerised solutions, understanding the security risks and benefits of docker, powering a continuous deployment pipeline with docker, debugging and instrumenting application containers, and guidance for implementing docker by containerising what you know.

Advertisements

Configure External Hyper-V Switch For Internet Access


To enable Hyper-V virtual machines to access the internet on  Windows Server 2012 or higher, from within Hyper-V select Virtual Switch Manager. Add a new virtual network switch and select External. From the drop down select the network adapter you want to use to connect to the internet, and select Allow management operating system to share this network adapter.

This will create a bridged network on the host computer. Edit the TCP/IP v4 settings for the external virtual switch on the host computer as follows:

  • Open a command window and type: ipconfig, then press enter.
  • Using the given details from the results of the command:
    • Modify the IP address
    • Subnet Mask
    • Default Gateway
    • Primary DNS
    • Enable Internet Connection Sharing
  • Add the external virtual switch to your virtual machine whilst it is turned off.
  • Start your virtual machine.
  • Edit your external virtual switch, and give it the same property values as the host external virtual switch.

Example:

IP Address: 192.168.1.47

Subnet Mask: 255.255.255.0

Default Gateway: 192.168.1.1

Preferred DNS Server: 192.168.1.1 (Default IP Address of XyXEL Routers, will more than likely be different for different routers.)

Once you have performed the above, you should have a working internet connection.

 

Application Displaying Different Data To What’s In Database


You are providing technical support to an end user, and uninstall the application, then remove the old database. Finally you install a new version of the software. But it is picking up the old data.

The probable cause is that Microsoft has put the database in the Microsoft Virtual Store folder location. This folder location can be found at: C:\Users\UserName.Domain\AppData\Local\VirtualStore\.

See: https://msdn.microsoft.com/en-us/library/aa905330.aspx.

And: http://blogs.msdn.com/b/patricka/archive/2009/12/14/tales-of-application-compatibility-weirdness-demystifying-uac-virtualization.aspx.

Windows XP Mode


If you have a Windows 7 Home Premium Edition computer and would like to have Windows XP with Service Pack 3 on your computer, the easiest thing to do is upgrade your operating system to either Windows 7 Professional Edition or Windows 7 Ultimate Edition. Then once you have done this, install Windows XP Mode from Microsoft. This will allow you to easily install and run applications that will only work in Windows XP from within Windows 7.