Last active
May 31, 2017 13:19
-
-
Save sixeyed/62bf7be72dae6c9ece6ceec745baff36 to your computer and use it in GitHub Desktop.
Secure Docker engine on Azure VM and copy certs to local
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$serverName = 'my.server.region.cloudapp.azure.com' | |
$externalIP = '1.2.3.4' | |
$internalIP = '10.0.0.4' | |
mkdir -p C:\certs\vm\client | |
docker run --rm ` | |
-e SERVER_NAME= $serverName ` | |
-e IP_ADDRESSES=127.0.0.1,$externalIP,$internalIP ` | |
-v 'C:\ProgramData\docker:C:\ProgramData\docker' ` | |
-v 'C:\certs\vm\client:C:\Users\ContainerAdministrator\.docker' ` | |
stefanscherer/dockertls-windows | |
Restart-Service docker | |
Enable-PSRemoting -Force | |
Set-NetFirewallProfile -Profile Domain,Public,Private -Enabled False |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$serverName = 'my.server.region.cloudapp.azure.com' | |
winrm set winrm/config/client '@{TrustedHosts="$serverName"}' | |
$SourceSession = New-PSSession -ComputerName $serverName -Credential (Get-Credential) | |
mkdir -p C:\certs\azure-vm | |
Copy-Item -FromSession $SourceSession -Path 'C:\certs\vm\client\' -Destination 'C:\certs\azure-vm\' -Recurse |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment