Skip to content

Instantly share code, notes, and snippets.

@glennswest
Created July 25, 2018 17:41
Show Gist options
  • Save glennswest/4bb29802fb4cb545370db85059e03bb7 to your computer and use it in GitHub Desktop.
Save glennswest/4bb29802fb4cb545370db85059e03bb7 to your computer and use it in GitHub Desktop.
$a = Test-Path "C:\k\docker_create.lock"
IF ($a -eq "True") {Write-Host "Docker Network Already Created";exit}
Write-Host "Creating Docker Network"
date > c:\k\docker_create.lock
$roughname = Get-NetAdapter | where adminstatus -eq "up" | Format-List -Property "Name" | Out
-String
$NetAdapterName = $roughname.Substring(11)
# multinode
#docker network create -d transparent --gateway 10.128.2.1 --subnet 10.128.2.0/24 -o com.docker.network.windowsshim.interface="Ethernet0" external
# Single node
docker network create -d transparent --gateway 10.128.1.1 --subnet 10.128.1.0/24 -o com.docker.network.windowsshim.interface=$NetAdapterName external
~
~
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment