#Docker Demos Container conf

# ------------ Cleanup
# Beenden aller Container
Get-container | Where-Object status -NotLike "*exited*" | Stop-Container 
docker stop $(docker ps -a -q)
# Entfernen aller Container (geht nur bei gestoppten Containern)
Get-container | Remove-Container
docker rm $(docker ps -a -q)
# Entfernen alles Images
docker rmi $(docker images -q)

docker images
Get-DirSize

docker pull “microsoft/nanoserver:latest”
docker run “microsoft/nanoserver:1709”

docker pull “microsoft/dotnet-samples:dotnetapp-nanoserver-1709"
docker run “microsoft/dotnet-samples:dotnetapp-nanoserver-1709" --isolation=hyperv

# https://docs.docker.com/samples/library/hello-world/
docker pull hello-world:nanoserver1709
docker run hello-world:nanoserver1709

# ------------------------ Linux (LinuxKit (13MB))

[Environment]::SetEnvironmentVariable("LCOW_SUPPORTED", "1", "Machine")
Restart-Service Docker

docker pull hello-world:linux
docker run hello-world:linux

# docker run -it supertest2014/nyan # Katze!

# ------------------------ Zurück zu Windows
[Environment]::SetEnvironmentVariable("LCOW_SUPPORTED", $null, "Machine")
Restart-Service Docker




function Get-DirSize
{
$objFSO = New-Object -com  Scripting.FileSystemObject
$objFO = $objFSO.GetFolder("C:\programdata\docker\windowsfilter")
"{0}: {1:N2}" -f $objFO.fullname, (($objFO.Size) / 1MB) + " MB"

#$colItems = (Get-ChildItem "C:\programdata\docker\windowsfilter" -recurse | Measure-Object -property length -sum)
#"{0:N2}" -f ($colItems.sum / 1MB) + " MB"
}

function prompt
{
    Write-Host ("PS " + $(get-date) +">") -nonewline -foregroundcolor Yellow
    return " "
}