fix(docs): fix duplicate instructions for windows installation

This commit fixes the duplicate copy and configure steps for
the Windows powershell scripts.

fixes #9887

It also adds the architecture as a variable in preparation for
the ARM64 support that is coming.

Signed-off-by: Anthony Nandaa <profnandaa@gmail.com>
This commit is contained in:
Anthony Nandaa 2024-02-28 11:17:39 +03:00
parent f0c64a9fa0
commit c5ef8a2c26

View File

@ -107,7 +107,7 @@ 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:
@ -115,16 +115,12 @@ 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"