# Jsou features k dispozici? pause Get-WindowsOptionalFeature -Online -FeatureName containers Get-WindowsOptionalFeature -Online -FeatureName *hyper* #Zapni features Enable-WindowsOptionalFeature -Online -FeatureName containers -All Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All #Restart-Computer -Force #Install docker Install-Module -Name DockerMsftProvider -Force Install-Package -Name docker -ProviderName DockerMsftProvider -Force #docker verze docker version #stahnout image docker pull microsoft/nanoserver docker pull microsoft/iis #list image docker images #run container #pripojit se a ukazat ipcofnig, ping, dism... #zastavit container #znovuspustit a pote smazat #run iis simple docker run -it --name mojeiis microsoft/iis –p 80:80 #ukazat dockerfile #build iis1 cd C:\build\iis1 docker build -t iis-site1 . docker images #build iis2 cd C:\build\iis2 docker build -t iis-site2 . docker images #docker run -it --name iis2 nanoserver_iis2 cmd #docker run –it --name iiscontainer –p 81:80 nanoserver_iis2 cmd #run iis1 docker run -it --name site1-cont1 iis-site1 -p8001:8000 #run iis2 docker run -it --name site2-cont1 iis-site2 -p8002:8000 #commit change docker container stop site1-cont1 docker commit site1-cont1 iis-final-image docker images #save image docker save --output C:\build\FinalVersion\iis-final-image.tar iis-final-image:latest #enable iis rule if (!(Get-NetFirewallRule | where {$_.Name –eq “TCP80”})) { New-NetFirewallRule –Name “TCP80” –DisplayName “HTTP on TCP/80” –Protocol tcp –LocalPort 80 –Action Allow -Enabled True} # Start docker service start-service docker # kontrola docker siti docker network ls docker network inspect nat #transparent network docker network create -d transparent transparent docker network ls NETWORK ID NAME DRIVER SCOPE b9a8a009158c nat nat local 4986b528d9ed none null local 7a0532a5e663 transparent transparent local docker run -ti --network=transparent microsoft/nanoserver ping 8.8.8.8