70-740, Teil 4.1.1. Installationsanforderungen und angemessene Szenarien für Windows-Container bestimmen

70-740, Teil 4.1.1.

Installationsanforderungen und angemessene Szenarien für Windows-Container bestimmen

Ideen für die Recherche im Web:

technet Windows Container

Zum Nachschlagen:

https://docs.microsoft.com/de-de/virtualization/windowscontainers/about/

https://docs.microsoft.com/de-de/virtualization/windowscontainers/deploy-containers/system-requirements

https://www.docker.com/why-docker

https://docs.docker.com/docker-for-windows/install/

https://docs.microsoft.com/de-de/virtualization/windowscontainers/quick-start/quick-start-windows-10#install-docker-for-windows

Übungen:

# Beispiel 1

Get-Module -Name DockerMsftProvider
#Bei Bedarf
#Install-Module -Name DockerMsftProvider

Get-PackageProvider -Name NuGet
#Bei Bedarf
#Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force

Get-Package -Name docker -ProviderName DockerMsftProvider
#Bei Bedarf
#Install-Package -Name docker -ProviderName DockerMsftProvider

Find-Module DockerMsftProvider
#Bei Bedarf
#Import-Module DockerMsftProvider -PassThru

Get-WindowsFeature Containers
#Bei Bedarf
#Install-WindowsFeature Containers

#Install-Module -Name PendingReboot; Test-PendingReboot
#Restart-Computer -Force

Get-Service docker
#Bei Bedarf
#Start-Service docker

docker search microsoft

docker search microsoft/windowsservercore

#https://docs.docker.com/engine/reference/commandline/search/

docker images

docker pull microsoft/nanoserver

docker images

docker run -it microsoft/nanoserver powershell

###

#Beispiel 2

#Get-NetFirewallRule -DisplayName *Datei- und Druckerfreigabe*

#Set-NetFirewallRule –Name “FPS-ICMP4-ERQ-Out” -Enabled

#Get-NetFirewallRule –Name “FPS-ICMP4-ERQ-Out” | Enable-NetFirewallRule

Install-Module PSWindowsUpdate

Get-Command –module PSWindowsUpdate

Get-WUInstall -MicrosoftUpdate -IgnoreUserInput -WhatIf -Verbose

Get-WUInstall –MicrosoftUpdate –AcceptAll –AutoReboot

Get-PSRepository

Find-Module *Container*

Install-PackageProvider ContainerImage

#Install-PackageProvider ContainerImage -Force

Install-Module -Name DockerMsftProvider -Repository PSGallery -Force

Install-Package -Name docker -ProviderName DockerMsftProvider
powershell

Install-WindowsFeature Containers

#Get-Command -Module Containers

###Restart-Computer -Force
#Bei Bedarf:
#Get-Package -Name Docker -ProviderName DockerMsftProvider
#Install-Package -Name Docker -ProviderName DockerMsftProvider -Update -Force
#Start-Service Docker
#sconfig -> 6) Download and Install Updates

docker search microsoft

docker pull microsoft/nanoserver

docker run -it microsoft/nanoserver cmd

Exit

docker run -d –name myIIS -p 80:80 microsoft/iis

docker exec -i myIIS cmd

del C:\inetpub\wwwroot\iisstart.htm

echo „Hallo Welt:) Viel Spaß bei der Zertifizierung;)“ > C:\inetpub\wwwroot\index.html

ipconfig

Exit

$ie = New-Object -ComObject InternetExplorer.Application
$ie.Navigate2(„10.101.2.10“)
$ie.Visible = $true

docker run -it microsoft/nanoserver powershell

Exit

docker run -it –isolation=hyperv microsoft/nanoserver cmd

Exit

docker ps

docker exec -ti <ContainerID> powershell

Exit

docker pull microsoft/windowsservercore

docker run -it microsoft/windowsservercore cmd

Exit

docker run -it microsoft/windowsservercore powershell

Exit

docker run -it –isolation=hyperv microsoft/windowsservercore cmd

Exit

#https://hub.docker.com/r/nanoserver/iis-mysql-php-wordpress/

####

###Webserver

docker pull nanoserver/iis

docker images

docker network ls

docker run –name nanoiis -d -it –network=a3915bd49ae0 nanoserver/iis

docker ps -a -f status=running

docker inspect -f „{{ .NetworkSettings.Networks.nat.IPAddress }}“ nanoiis

docker inspect c6c1e131bc165a55a835a568bd33fe76a43ee2402f9a5239988d58021b511906

docker inspect –format=“{{.Id}}“ nanoiis

docker ps -a -f status=running

$container_nanoiis= docker inspect –format=“{{.Id}}“ nanoiis

$sesion = New-PSSession -ContainerId $container_nanoiis -RunAsAdministrator

Enter-PSSession -Session $sesion

ipconfig /all

Exit-PSSession

Invoke-Command -Session $sesion -ScriptBlock {ipconfig /all}

# ie http://10.102.4.8/

dir C:\inetpub\wwwroot\

Copy-Item -Path C:/Container\default.html -Destination C:\inetpub\wwwroot\iisstart.htm -ToSession $sesion

$ie = New-Object -ComObject InternetExplorer.Application

$ie.Navigate2(„http://10.102.4.8“)

$ie.Visible = $true

docker stop nanoiis

docker rm nanoiis

docker ps

###Wordpress

docker pull nanoserver/iis-mysql-php-wordpress

docker images

docker network ls

docker run –name wordpress -d -it –network=a3915bd49ae0 nanoserver/iis-mysql-php-wordpress

#Bei Bedarf
#docker ps
#docker stop wordpress
#docker stop 22cb01a9de752960860a5054bd19237963ec0dd0ce3fd05c33890e224a7d2c56
#docker rm 22cb01a9de752960860a5054bd19237963ec0dd0ce3fd05c33890e224a7d2c56
#docker rm wordpress
#docker ps

docker ps -a -f status=running

docker inspect –format=“{{.Id}}“ wordpress

$container_id_wordpress = docker inspect –format=“{{.Id}}“ wordpress

echo $container_id_wordpress

docker ps -a -f status=running

Invoke-Command -Session $session -ScriptBlock {ipconfig /all}

#Alternativ:

#$session = New-PSSession -ContainerId $container_id_wordpress -RunAsAdministrator

#Enter-PSSession -Session $session

#ipconfig /all

#Exit-PSSession

$ie = New-Object -ComObject InternetExplorer.Application

$ie.Navigate2(„http://10.102.4.17“)

$ie.Visible = $true

docker stop wordpress

docker rm wordpress

docker ps