@@ -110,8 +110,11 @@ To install containerd and its dependencies from the source, see [`BUILDING.md`](
110
110
From a PowerShell session run the following commands:
111
111
112
112
``` PowerShell
113
+ # If containerd previously installed run:
114
+ Stop-Service containerd
115
+
113
116
# Download and extract desired containerd Windows binaries
114
- $Version="1.6.4"
117
+ $Version="1.7.13" # update to your preferred version
115
118
curl.exe -L https://github.com/containerd/containerd/releases/download/v$Version/containerd-$Version-windows-amd64.tar.gz -o containerd-windows-amd64.tar.gz
116
119
tar.exe xvf .\containerd-windows-amd64.tar.gz
117
120
@@ -120,16 +123,41 @@ Copy-Item -Path ".\bin" -Destination "$Env:ProgramFiles\containerd" -Recurse -Co
120
123
cd $Env:ProgramFiles\containerd\
121
124
.\containerd.exe config default | Out-File config.toml -Encoding ascii
122
125
126
+ # Copy
127
+ Copy-Item -Path .\bin\* -Destination (New-Item -Type Directory $Env:ProgramFiles\containerd -Force) -Recurse -Force
128
+
129
+ # add the binaries (containerd.exe, ctr.exe) in $env:Path
130
+ $Path = [Environment]::GetEnvironmentVariable("PATH", "Machine") + [IO.Path]::PathSeparator + "$Env:ProgramFiles\containerd"
131
+ [Environment]::SetEnvironmentVariable( "Path", $Path, "Machine")
132
+ # reload path, so you don't have to open a new PS terminal later if needed
133
+ $Env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User")
134
+
135
+ # configure
136
+ containerd.exe config default | Out-File $Env:ProgramFiles\containerd\config.toml -Encoding ascii
123
137
# Review the configuration. Depending on setup you may want to adjust:
124
138
# - the sandbox_image (Kubernetes pause image)
125
139
# - cni bin_dir and conf_dir locations
126
- Get-Content config.toml
140
+ Get-Content $Env:ProgramFiles\containerd\ config.toml
127
141
128
142
# Register and start service
129
- .\ containerd.exe --register-service
143
+ containerd.exe --register-service
130
144
Start-Service containerd
131
145
```
132
146
147
+ > ** Tip for Running ` containerd ` Service on Windows:**
148
+ >
149
+ > ` containerd ` logs are not persisted when we start it as a service
150
+ using Windows Service Manager. [ ` nssm ` ] ( https://nssm.cc ) can be used to
151
+ configure logs to go into a cyclic buffer:
152
+ > ``` powershell
153
+ > nssm.exe install containerd
154
+ > nssm.exe set containerd AppStdout "\containerd.log"
155
+ > nssm.exe set containerd AppStderr "\containerd.err.log"
156
+ > nssm.exe start containerd
157
+ > # to stop:
158
+ > nssm.exe stop containerd
159
+ > ```
160
+
133
161
## Interacting with containerd via CLI
134
162
135
163
There are several command line interface (CLI) projects for interacting with containerd:
0 commit comments