Run Linux containers on Windows | windows docker run linux image
First,createtwodirectories:CreateC:lcow,whichwillbeusedasscratchspaceforDockerwhilepreparingthecontainers.AlsocreateC:ProgramFilesLinuxContainers.ThisiswheretheUbuntucontainerimagewilllive.YouwillneedtogivethisfolderextrapermissionstoallowDockertousetheimagesfromit.RunthefollowingPowershellscriptinanadministratorPowershellwindow:param([string]$Root)#Givethevirtualmachinesgroupfullcontrol$acl=Get-Acl-Path$Root$vmGroupRule=new-objectSystem.Security.AccessControl.FileSystemAccessRule("NTVIRTUAL...
First, create two directories:
Create C:lcow, which will be used as scratch space for Docker while preparing the containers.
Also create C:Program FilesLinux Containers. This is where the Ubuntu container image will live.
You will need to give this folder extra permissions to allow Docker to use the images from it. Run the following Powershell script in an administrator Powershell window:
param( [string] $Root ) # Give the virtual machines group full control $acl = Get-Acl -Path $Root $vmGroupRule = new-object System.Security.AccessControl.FileSystemAccessRule("NT VIRTUAL MACHINEVirtual Machines", "FullControl","ContainerInherit,ObjectInherit", "None", "Allow") $acl.SetAccessRule($vmGroupRule) Set-Acl -AclObject $acl -Path $RootSave this file as set_perms.ps1 and run it:
TIP You may need to run ‘Set-ExecutionPolicy -Scope process unrestricted’ to be allowed to run unsigned Powershe...