Merge pull request #9894 from profnandaa/docs/fix-windows-instructions-2

fix(docs): fix duplicate instructions for windows installation
This commit is contained in:
Akihiro Suda 2024-04-23 23:54:59 +00:00 committed by GitHub
commit 9d108fa83b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -107,24 +107,20 @@ To install containerd and its dependencies from the source, see [`BUILDING.md`](
## Installing containerd on Windows ## Installing containerd on Windows
From a PowerShell session run the following commands: From an elevated PowerShell session (_running as Admin_) run the following commands:
```PowerShell ```PowerShell
# If containerd previously installed run: # If containerd previously installed run:
Stop-Service containerd Stop-Service containerd
# Download and extract desired containerd Windows binaries # Download and extract desired containerd Windows binaries
$Version="1.7.13" # update to your preferred version $Version="1.7.13" # update to your preferred version
curl.exe -L https://github.com/containerd/containerd/releases/download/v$Version/containerd-$Version-windows-amd64.tar.gz -o containerd-windows-amd64.tar.gz $Arch = "amd64" # arm64 also available
tar.exe xvf .\containerd-windows-amd64.tar.gz curl.exe -LO https://github.com/containerd/containerd/releases/download/v$Version/containerd-$Version-windows-$Arch.tar.gz
tar.exe xvf .\containerd-$Version-windows-amd64.tar.gz
# Copy and configure
Copy-Item -Path ".\bin" -Destination "$Env:ProgramFiles\containerd" -Recurse -Container:$false -Force
cd $Env:ProgramFiles\containerd\
.\containerd.exe config default | Out-File config.toml -Encoding ascii
# Copy # Copy
Copy-Item -Path .\bin\* -Destination (New-Item -Type Directory $Env:ProgramFiles\containerd -Force) -Recurse -Force Copy-Item -Path .\bin -Destination $Env:ProgramFiles\containerd -Recurse -Force
# add the binaries (containerd.exe, ctr.exe) in $env:Path # add the binaries (containerd.exe, ctr.exe) in $env:Path
$Path = [Environment]::GetEnvironmentVariable("PATH", "Machine") + [IO.Path]::PathSeparator + "$Env:ProgramFiles\containerd" $Path = [Environment]::GetEnvironmentVariable("PATH", "Machine") + [IO.Path]::PathSeparator + "$Env:ProgramFiles\containerd"