Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Windows Container] Replace gzip with pigz for Windows docker extraction #337

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions packer/scripts/windows/scoop-install-commons-docker-support.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,19 @@ aws --version
# Install zip
scoop install zip

# Replace gzip with pigz/unpigz for docker extration
# The pigz binary on the Windows OS is from this PR: https://github.com/kubernetes/kubernetes/pull/96470
# It seems like pigz/unpigz can only be detect by docker if it is in [System.EnvironmentVariableTarget]::Machine env vars
# Per this PR it uses LookPath: https://github.com/moby/moby/pull/35697, which checks the system path here: https://pkg.go.dev/v.io/x/lib/lookpath
Set-MpPreference -DisableRealtimeMonitoring $true
$pigzPath = "C:\pigz"
mkdir $pigzPath
curl.exe -SL "https://ci.opensearch.org/ci/dbc/tools/pigz-2.3.1-20201104-134221-gke-release-windows.zip" -o "$pigzPath\\pigz.zip"
unzip "$pigzPath\\pigz.zip" -d $pigzPath
rm -v "$pigzPath\\*.zip"
$machineenv = [System.Environment]::GetEnvironmentVariable("Path", [System.EnvironmentVariableTarget]::Machine)
[System.Environment]::SetEnvironmentVariable("PATH", $machineenv + ";$pigzPath", [System.EnvironmentVariableTarget]::Machine)

# Setup Docker
echo "Enable Hyper-V"
Enable-WindowsOptionalFeature -Online -FeatureName "Microsoft-Hyper-V" -All -NoRestart
Expand Down