Skip to content

chabater/run-container-on-windows-server-2019

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DISM /Online /Enable-Feature /All /FeatureName:Microsoft-Hyper-V

bcdedit /set hypervisorlaunchtype auto

Install-WindowsFeature -Name Hyper-V -ComputerName windows-lab-2 -IncludeManagementTools -Restart

New-VM -Name WinContainerHost -MemoryStartupBytes 1GB

Install-Module DockerMSFTProvider

Import-Module -Name DockerMSFTProvider -Force

Import-Packageprovider -Name DockerMSFTProvider -Force

Install-Package -Name Docker -Source DockerDefault

[Environment]::SetEnvironmentVariable("LCOW_SUPPORTED", "1", "Machine")

[System.Environment]::SetEnvironmentVariable("LCOW_API_PLATFORM_IF_OMITTED", "linux",[System.EnvironmentVariableTarget]::Machine)

Invoke-WebRequest -Uri "https://github.com/linuxkit/lcow/releases/download/v4.14.35-v0.3.9/release.zip" -UseBasicParsing -OutFile release.zip

Expand-Archive release.zip -DestinationPath "$Env:ProgramFiles\Linux Containers."

Restart-service docker

Enable-WindowsOptionalFeature -Online -FeatureName containers -All

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux

dockerd --register-service --experimental



# mcr

Invoke-WebRequest -Uri https://get.mirantis.com/install.ps1 -o install.ps1

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force -Scope Process;

.\install.ps1 -Offline



download mode

Expand-Archive .\Docker-18-09-14.zip -destinationpath $Env:Programfiles -Force

$null = Install-WindowsFeature containers

 $env:Path += ";$env:ProgramFiles\docker"

 $newpath ="$env:ProgramFiles\docker;" +
>> [Environment]::GetEnvironmentVariable("path",
>> [EnvironmentVariableTarget]::Machine)

[Environment]::SetEnvironmentVariable("PATH", $newPath,
>> [EnvironmentVariableTarget]::Machine)

dockerd --register-service

ISM /Online /Enable-Feature /All /FeatureName:Microsoft-Hyper-V

bcdedit /set hypervisorlaunchtype auto
bcdedit /set hypervisorlaunchtype Auto

Install-WindowsFeature -Name Hyper-V -IncludeManagementTools -Restart

New-VM -Name WinContainerHost -MemoryStartupBytes 1GB

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All

Enable-WindowsOptionalFeature -Online -FeatureName containers -All
Enable-WindowsOptionalFeature -Online -FeatureName containers -All

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux

Enable-WindowsOptionalFeature -Online -FeatureName virtualmachineplatform

Expand-Archive release.zip -DestinationPath "$Env:ProgramFiles\Linux Containers."

[System.Environment]::SetEnvironmentVariable("LCOW_API_PLATFORM_IF_OMITTED", "linux",[System.EnvironmentVariableTarget]::Machine)

 dockerd --register-service --experimental

 Restart-service docker

docker run --platform linux --name some-nginx -v /some/content:/usr/share/nginx/html:ro -d nginx

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published