PS > Disable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V-All
Powershell Installation ScriptInstalls :
PS > if (!(Get-Command "choco" -errorAction SilentlyContinue))
{
$env:ChocolateyInstall="D:\Program Files\Chocolatey"
iwr https://chocolatey.org/install.ps1 -UseBasicParsing | iex;`
}
choco upgrade virtualbox -y;refreshenv;`
choco upgrade docker -y;refreshenv;`
choco upgrade docker-machine -y;refreshenv;`
docker-machine create --driver virtualbox --virtualbox-hostonly-cidr "192.168.90.1/24" default;`
docker-machine env default | Invoke-Expression;`
write-host "Containers will be running here : $(docker-machine ip). Now you can 'docker run' Linux images" -foreground "green"
Sql Server 2016
The same script, but in addition, runs a container with SQL Server 2016 (displays connection information after running)
PS > if (!(Get-Command "choco" -errorAction SilentlyContinue))
{
$env:ChocolateyInstall="D:\Program Files\Chocolatey"
iwr https://chocolatey.org/install.ps1 -UseBasicParsing | iex;`
}
choco upgrade virtualbox -y;refreshenv;`
choco upgrade docker -y;refreshenv;`
choco upgrade docker-machine -y;refreshenv;`
docker-machine create --driver virtualbox --virtualbox-hostonly-cidr "192.168.90.1/24" --virtualbox-memory 3330 default;`
docker-machine env default | Invoke-Expression;`
docker run -it -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=Password@123" -p 1433:1433 -d microsoft/mssql-server-linux;`
write-host "Connect to SQL Server here : $(docker-machine ip):1433 Username : 'sa' Password 'Password@123'" -foreground "green"
View the IP of your docker-machine allocated Linux host VM
PS > docker-machine ip
SSH Into the VM
PS > docker-machine ssh
View all Docker processes on the VM (after SSHing)
> docker ps -a
View logs from a docker process (after SSHing, where `name` is the name of the container seen in the `ps` command)
> docker logs `name`
Destroy the VM
PS> docker-machine rm -f default
Docker for the Win
Page created by @BrianRosamilia Contribute to this page here