Friday, 3 June 2016

Deploying Container Hosts

Posted by Ashwin Venugopal

Install the container feature
Install-WindowsFeature containers

Install the Hyper-V role (optional)
Install-WindowsFeature hyper-v

Enable nested virtualization (Only if its a Hyper-V Containers)
Set-VMProcessor -VMName <container host vm name> -ExposeVirtualizationExtensions $true

Configure virtual processors (Only if its a Hyper-V Containers)
Set-VMProcessor –VMName <container host vm name> -Count 2

Create a virtual switch
New-VMSwitch -Name "Virtual Switch" -SwitchType type
All containers connect to this virtual switch for communications. The switch type can be Private, Internal, External, or NAT.

Configure NAT settings
If you have configured virtual switch with NAT, you must configure the NAT settings.
New-NetNat -Name <Name> -InternalIPInterfaceAddressPrefix "<subnet>"

Configure MAC address spoofing (Optional)
If the container host is virtualized, we got to enable MAC address spoofing. 
Get-VMNetworkAdapter -VMName <container host vm> | Set-VMNetworkAdapter -

MacAddressSpoofing On

Install container operating system images

  1. Install-PackageProvider ContainerProvider –Force
    1. This installs the required Windows PowerShell module.
  2. Find-ContainerImage
    1. This lists the available images by Name, version number, and description.
  3. Install-ContainerImage -Name ImageName -Version Number.
    1. This installs the <ImageName> image


Install Docker (Optional)


  1. Download the Docker engine and client as a zip archive.
    1. Invoke-WebRequest "https://get.docker.com/builds/Windows/x86_64/docker-1.12.0.zip" -OutFile "$env:TEMP\docker-1.12.0.zip" -UseBasicParsing
  2. Expand the zip archive into Program Files.
    1. Expand-Archive -Path "$env:TEMP\docker-1.12.0.zip" -DestinationPath $env:ProgramFiles
  3. Add the Docker directory to the system path.
    1. $env:path += ";c:\program files\docker"
  4. To install Docker as a Windows service, run the following.
    1. dockerd --register-service
  5. Once installed, start the service.
    1. Start-Service docker
Thanks for reading.



No comments:

Post a Comment