Scripts/Docker.ps1
# https://docs.microsoft.com/en-us/virtualization/windowscontainers/quick-start/set-up-environment?tabs=dockerce#windows-server-1 choco install docker-cli choco install docker-engine choco install docker-compose [System.Environment]::SetEnvironmentVariable("DockerFolder", "$($env:Onedrive)\Docker", "Machine") # $env:DockerFolder = "C:\Docker" # $env:DockerFolder = Join-Path $Env:OneDrive Docker # REBOOT Get-Service docker New-Item $env:DockerFolder -ItemType Directory -Force Set-Location $env:DockerFolder # docker pull lordmilko/prtg docker pull mcr.microsoft.com/windows/servercore:ltsc2022 # Images weergeven docker images docker image prune docker image prune -f # Containers weergeven docker container ls -a ## Gestopte containers verwijderen docker container prune docker container prune -f # Docker container bouwen Set-Location C:\Docker\PrtgDocker-master docker build . -t prtg # Docker container maken en starten docker run --name prtg -m 4G -d -it -p 8080:80 --restart unless-stopped prtg # Docker container starten docker container start prtg # Docker container bedienen docker exec -ti prtg powershell # Docker container backup docker container commit prtg prtgbackup:backup docker image save -o prtgbackup.tar prtgbackup # Docker image restore docker image load prtgbackup.tar # Fix network error Stop-Service docker Stop-Service hns Start-Service hns Start-Service docker docker network prune -f # Adminportal New-Item $($env:DockerFolder)\adminportal\Dockerfile -ItemType File -Force docker-compose down docker container stop adminportal docker container prune -f docker image rm adminportal docker image prune -f docker build "$($env:DockerFolder)\AdminPortal" -t adminportal docker-compose up -d docker run --name adminportal -d -it -p 50808:80 --restart unless-stopped adminportal docker exec -ti adminportal powershell docker-compose down; docker build . -t ((Get-Item .).Name); docker-compose up -d docker exec -ti intunecheck powershell ## Linux / WSL sudo docker-compose down sudo docker container stop phpsite1 sudo docker container prune -f sudo docker image rm phpsite1 sudo docker image prune -f sudo docker build . -t phpsite1 sudo docker-compose up -d |