Browse code

ci(windows): move windows-2019 to another workflow

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>

CrazyMax authored on 2022/08/26 11:09:48
Showing 7 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,494 @@
0
+# reusable workflow
1
+name: windows
2
+
3
+on:
4
+  workflow_call:
5
+    inputs:
6
+      os:
7
+        required: true
8
+        type: string
9
+      send_coverage:
10
+        required: false
11
+        type: boolean
12
+        default: false
13
+
14
+env:
15
+  GO_VERSION: 1.18.5
16
+  GOTESTLIST_VERSION: v0.2.0
17
+  TESTSTAT_VERSION: v0.1.3
18
+  WINDOWS_BASE_IMAGE: mcr.microsoft.com/windows/servercore
19
+  WINDOWS_BASE_TAG_2019: ltsc2019
20
+  WINDOWS_BASE_TAG_2022: ltsc2022
21
+  TEST_IMAGE_NAME: moby:test
22
+  TEST_CTN_NAME: moby
23
+  DOCKER_BUILDKIT: 0
24
+  ITG_CLI_MATRIX_SIZE: 6
25
+
26
+jobs:
27
+  build:
28
+    runs-on: ${{ inputs.os }}
29
+    env:
30
+      GOPATH: ${{ github.workspace }}\go
31
+      GOBIN: ${{ github.workspace }}\go\bin
32
+      BIN_OUT: ${{ github.workspace }}\out
33
+    defaults:
34
+      run:
35
+        working-directory: ${{ env.GOPATH }}/src/github.com/docker/docker
36
+    steps:
37
+      -
38
+        name: Checkout
39
+        uses: actions/checkout@v3
40
+        with:
41
+          path: ${{ env.GOPATH }}/src/github.com/docker/docker
42
+      -
43
+        name: Env
44
+        run: |
45
+          Get-ChildItem Env: | Out-String
46
+      -
47
+        name: Init
48
+        run: |
49
+          New-Item -ItemType "directory" -Path "${{ github.workspace }}\go-build"
50
+          New-Item -ItemType "directory" -Path "${{ github.workspace }}\go\pkg\mod"
51
+          If ("${{ inputs.os }}" -eq "windows-2019") {
52
+            echo "WINDOWS_BASE_IMAGE_TAG=${{ env.WINDOWS_BASE_TAG_2019 }}" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
53
+          } ElseIf ("${{ inputs.os }}" -eq "windows-2022") {
54
+            echo "WINDOWS_BASE_IMAGE_TAG=${{ env.WINDOWS_BASE_TAG_2022 }}" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
55
+          }
56
+      -
57
+        name: Cache
58
+        uses: actions/cache@v3
59
+        with:
60
+          path: |
61
+            ~\AppData\Local\go-build
62
+            ~\go\pkg\mod
63
+            ${{ github.workspace }}\go-build
64
+            ${{ env.GOPATH }}\pkg\mod
65
+          key: ${{ inputs.os }}-${{ github.job }}-${{ hashFiles('**/vendor.sum') }}
66
+          restore-keys: |
67
+            ${{ inputs.os }}-${{ github.job }}-
68
+      -
69
+        name: Docker info
70
+        run: |
71
+          docker info
72
+      -
73
+        name: Build base image
74
+        run: |
75
+          docker pull ${{ env.WINDOWS_BASE_IMAGE }}:${{ env.WINDOWS_BASE_IMAGE_TAG }}
76
+          docker tag ${{ env.WINDOWS_BASE_IMAGE }}:${{ env.WINDOWS_BASE_IMAGE_TAG }} microsoft/windowsservercore
77
+          docker build --build-arg GO_VERSION -t ${{ env.TEST_IMAGE_NAME }} -f Dockerfile.windows .
78
+      -
79
+        name: Build binaries
80
+        run: |
81
+          & docker run --name ${{ env.TEST_CTN_NAME }} -e "DOCKER_GITCOMMIT=${{ github.sha }}" `
82
+              -v "${{ github.workspace }}\go-build:C:\Users\ContainerAdministrator\AppData\Local\go-build" `
83
+              -v "${{ github.workspace }}\go\pkg\mod:C:\gopath\pkg\mod" `
84
+              ${{ env.TEST_IMAGE_NAME }} hack\make.ps1 -Daemon -Client
85
+      -
86
+        name: Copy artifacts
87
+        run: |
88
+          New-Item -ItemType "directory" -Path "${{ env.BIN_OUT }}"
89
+          docker cp "${{ env.TEST_CTN_NAME }}`:c`:\gopath\src\github.com\docker\docker\bundles\docker.exe" ${{ env.BIN_OUT }}\
90
+          docker cp "${{ env.TEST_CTN_NAME }}`:c`:\gopath\src\github.com\docker\docker\bundles\dockerd.exe" ${{ env.BIN_OUT }}\
91
+          docker cp "${{ env.TEST_CTN_NAME }}`:c`:\gopath\bin\gotestsum.exe" ${{ env.BIN_OUT }}\
92
+          docker cp "${{ env.TEST_CTN_NAME }}`:c`:\containerd\bin\containerd.exe" ${{ env.BIN_OUT }}\
93
+          docker cp "${{ env.TEST_CTN_NAME }}`:c`:\containerd\bin\containerd-shim-runhcs-v1.exe" ${{ env.BIN_OUT }}\
94
+      -
95
+        name: Upload artifacts
96
+        uses: actions/upload-artifact@v3
97
+        with:
98
+          name: build-${{ inputs.os }}
99
+          path: ${{ env.BIN_OUT }}/*
100
+          if-no-files-found: error
101
+          retention-days: 2
102
+
103
+  unit-test:
104
+    runs-on: ${{ inputs.os }}
105
+    env:
106
+      GOPATH: ${{ github.workspace }}\go
107
+      GOBIN: ${{ github.workspace }}\go\bin
108
+    defaults:
109
+      run:
110
+        working-directory: ${{ env.GOPATH }}/src/github.com/docker/docker
111
+    steps:
112
+      -
113
+        name: Checkout
114
+        uses: actions/checkout@v3
115
+        with:
116
+          path: ${{ env.GOPATH }}/src/github.com/docker/docker
117
+      -
118
+        name: Env
119
+        run: |
120
+          Get-ChildItem Env: | Out-String
121
+      -
122
+        name: Init
123
+        run: |
124
+          New-Item -ItemType "directory" -Path "${{ github.workspace }}\go-build"
125
+          New-Item -ItemType "directory" -Path "${{ github.workspace }}\go\pkg\mod"
126
+          New-Item -ItemType "directory" -Path "bundles"
127
+          If ("${{ inputs.os }}" -eq "windows-2019") {
128
+            echo "WINDOWS_BASE_IMAGE_TAG=${{ env.WINDOWS_BASE_TAG_2019 }}" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
129
+          } ElseIf ("${{ inputs.os }}" -eq "windows-2022") {
130
+            echo "WINDOWS_BASE_IMAGE_TAG=${{ env.WINDOWS_BASE_TAG_2022 }}" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
131
+          }
132
+      -
133
+        name: Cache
134
+        uses: actions/cache@v3
135
+        with:
136
+          path: |
137
+            ~\AppData\Local\go-build
138
+            ~\go\pkg\mod
139
+            ${{ github.workspace }}\go-build
140
+            ${{ env.GOPATH }}\pkg\mod
141
+          key: ${{ inputs.os }}-${{ github.job }}-${{ hashFiles('**/vendor.sum') }}
142
+          restore-keys: |
143
+            ${{ inputs.os }}-${{ github.job }}-
144
+      -
145
+        name: Docker info
146
+        run: |
147
+          docker info
148
+      -
149
+        name: Build base image
150
+        run: |
151
+          docker pull ${{ env.WINDOWS_BASE_IMAGE }}:${{ env.WINDOWS_BASE_IMAGE_TAG }}
152
+          docker tag ${{ env.WINDOWS_BASE_IMAGE }}:${{ env.WINDOWS_BASE_IMAGE_TAG }} microsoft/windowsservercore
153
+          docker build --build-arg GO_VERSION -t ${{ env.TEST_IMAGE_NAME }} -f Dockerfile.windows .
154
+      -
155
+        name: Test
156
+        run: |
157
+          & docker run --name ${{ env.TEST_CTN_NAME }} -e "DOCKER_GITCOMMIT=${{ github.sha }}" `
158
+            -v "${{ github.workspace }}\go-build:C:\Users\ContainerAdministrator\AppData\Local\go-build" `
159
+            -v "${{ github.workspace }}\go\pkg\mod:C:\gopath\pkg\mod" `
160
+            -v "${{ env.GOPATH }}\src\github.com\docker\docker\bundles:C:\gopath\src\github.com\docker\docker\bundles" `
161
+            ${{ env.TEST_IMAGE_NAME }} hack\make.ps1 -TestUnit
162
+      -
163
+        name: Send to Codecov
164
+        if: inputs.send_coverage
165
+        uses: codecov/codecov-action@v3
166
+        with:
167
+          working-directory: ${{ env.GOPATH }}\src\github.com\docker\docker
168
+          directory: bundles
169
+          env_vars: RUNNER_OS
170
+          flags: unit
171
+      -
172
+        name: Upload reports
173
+        if: always()
174
+        uses: actions/upload-artifact@v3
175
+        with:
176
+          name: ${{ inputs.os }}-unit-reports
177
+          path: ${{ env.GOPATH }}\src\github.com\docker\docker\bundles\*
178
+
179
+  unit-test-report:
180
+    runs-on: ubuntu-latest
181
+    if: always()
182
+    needs:
183
+      - unit-test
184
+    steps:
185
+      -
186
+        name: Set up Go
187
+        uses: actions/setup-go@v3
188
+        with:
189
+          go-version: ${{ env.GO_VERSION }}
190
+      -
191
+        name: Download artifacts
192
+        uses: actions/download-artifact@v3
193
+        with:
194
+          name: ${{ inputs.os }}-unit-reports
195
+          path: /tmp/artifacts
196
+      -
197
+        name: Install teststat
198
+        run: |
199
+          go install github.com/vearutop/teststat@${{ env.TESTSTAT_VERSION }}
200
+      -
201
+        name: Create summary
202
+        run: |
203
+          teststat -markdown $(find /tmp/artifacts -type f -name '*.json' -print0 | xargs -0) >> $GITHUB_STEP_SUMMARY
204
+
205
+  integration-test-prepare:
206
+    runs-on: ubuntu-latest
207
+    outputs:
208
+      matrix: ${{ steps.tests.outputs.matrix }}
209
+    steps:
210
+      -
211
+        name: Checkout
212
+        uses: actions/checkout@v3
213
+      -
214
+        name: Set up Go
215
+        uses: actions/setup-go@v3
216
+        with:
217
+          go-version: ${{ env.GO_VERSION }}
218
+      -
219
+        name: Install gotestlist
220
+        run:
221
+          go install github.com/crazy-max/gotestlist/cmd/gotestlist@${{ env.GOTESTLIST_VERSION }}
222
+      -
223
+        name: Create matrix
224
+        id: tests
225
+        working-directory: ./integration-cli
226
+        run: |
227
+          # Distribute integration-cli tests for the matrix in integration-test job.
228
+          # Also prepend ./... to the matrix. This is a special case to run "Test integration" step exclusively.
229
+          matrix="$(gotestlist -d ${{ env.ITG_CLI_MATRIX_SIZE }} ./...)"
230
+          matrix="$(echo "$matrix" | jq -c '. |= ["./..."] + .')"
231
+          echo "::set-output name=matrix::$matrix"
232
+      -
233
+        name: Show matrix
234
+        run: |
235
+          echo ${{ steps.tests.outputs.matrix }}
236
+
237
+  integration-test:
238
+    runs-on: ${{ inputs.os }}
239
+    needs:
240
+      - build
241
+      - integration-test-prepare
242
+    strategy:
243
+      fail-fast: false
244
+      matrix:
245
+        runtime:
246
+          - builtin
247
+          - containerd
248
+        test: ${{ fromJson(needs.integration-test-prepare.outputs.matrix) }}
249
+    env:
250
+      GOPATH: ${{ github.workspace }}\go
251
+      GOBIN: ${{ github.workspace }}\go\bin
252
+      BIN_OUT: ${{ github.workspace }}\out
253
+    defaults:
254
+      run:
255
+        working-directory: ${{ env.GOPATH }}/src/github.com/docker/docker
256
+    steps:
257
+      -
258
+        name: Checkout
259
+        uses: actions/checkout@v3
260
+        with:
261
+          path: ${{ env.GOPATH }}/src/github.com/docker/docker
262
+      -
263
+        name: Env
264
+        run: |
265
+          Get-ChildItem Env: | Out-String
266
+      -
267
+        name: Download artifacts
268
+        uses: actions/download-artifact@v3
269
+        with:
270
+          name: build-${{ inputs.os }}
271
+          path: ${{ env.BIN_OUT }}
272
+      -
273
+        name: Init
274
+        run: |
275
+          New-Item -ItemType "directory" -Path "bundles"
276
+          If ("${{ inputs.os }}" -eq "windows-2019") {
277
+            echo "WINDOWS_BASE_IMAGE_TAG=${{ env.WINDOWS_BASE_TAG_2019 }}" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
278
+          } ElseIf ("${{ inputs.os }}" -eq "windows-2022") {
279
+            echo "WINDOWS_BASE_IMAGE_TAG=${{ env.WINDOWS_BASE_TAG_2022 }}" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
280
+          }
281
+          Write-Output "${{ env.BIN_OUT }}" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
282
+      -
283
+        # removes docker service that is currently installed on the runner. we
284
+        # could use Uninstall-Package but not yet available on Windows runners.
285
+        # more info: https://github.com/actions/virtual-environments/blob/d3a5bad25f3b4326c5666bab0011ac7f1beec95e/images/win/scripts/Installers/Install-Docker.ps1#L11
286
+        name: Removing current daemon
287
+        run: |
288
+          if (Get-Service docker -ErrorAction SilentlyContinue) {
289
+            $dockerVersion = (docker version -f "{{.Server.Version}}")
290
+            Write-Host "Current installed Docker version: $dockerVersion"
291
+            # remove service
292
+            Stop-Service -Force -Name docker
293
+            Remove-Service -Name docker
294
+            # removes event log entry. we could use "Remove-EventLog -LogName -Source docker"
295
+            # but this cmd is not available atm
296
+            $ErrorActionPreference = "SilentlyContinue"
297
+            & reg delete "HKLM\SYSTEM\CurrentControlSet\Services\EventLog\Application\docker" /f 2>&1 | Out-Null
298
+            $ErrorActionPreference = "Stop"
299
+            Write-Host "Service removed"
300
+          }
301
+      -
302
+        name: Starting containerd
303
+        if: matrix.runtime == 'containerd'
304
+        run: |
305
+          Write-Host "Generating config"
306
+          & "${{ env.BIN_OUT }}\containerd.exe" config default | Out-File "$env:TEMP\ctn.toml" -Encoding ascii
307
+          Write-Host "Creating service"
308
+          New-Item -ItemType Directory "$env:TEMP\ctn-root" -ErrorAction SilentlyContinue | Out-Null
309
+          New-Item -ItemType Directory "$env:TEMP\ctn-state" -ErrorAction SilentlyContinue | Out-Null
310
+          Start-Process -Wait "${{ env.BIN_OUT }}\containerd.exe" `
311
+            -ArgumentList "--log-level=debug", `
312
+              "--config=$env:TEMP\ctn.toml", `
313
+              "--address=\\.\pipe\containerd-containerd", `
314
+              "--root=$env:TEMP\ctn-root", `
315
+              "--state=$env:TEMP\ctn-state", `
316
+              "--log-file=$env:TEMP\ctn.log", `
317
+              "--register-service"
318
+          Write-Host "Starting service"
319
+          Start-Service -Name containerd
320
+          Start-Sleep -Seconds 5
321
+          Write-Host "Service started successfully!"
322
+      -
323
+        name: Starting test daemon
324
+        run: |
325
+          Write-Host "Creating service"
326
+          If ("${{ matrix.runtime }}" -eq "containerd") {
327
+            $runtimeArg="--containerd=\\.\pipe\containerd-containerd"
328
+            echo "DOCKER_WINDOWS_CONTAINERD_RUNTIME=1" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
329
+          }
330
+          New-Item -ItemType Directory "$env:TEMP\moby-root" -ErrorAction SilentlyContinue | Out-Null
331
+          New-Item -ItemType Directory "$env:TEMP\moby-exec" -ErrorAction SilentlyContinue | Out-Null
332
+          Start-Process -Wait -NoNewWindow "${{ env.BIN_OUT }}\dockerd" `
333
+            -ArgumentList $runtimeArg, "--debug", `
334
+              "--host=npipe:////./pipe/docker_engine", `
335
+              "--data-root=$env:TEMP\moby-root", `
336
+              "--exec-root=$env:TEMP\moby-exec", `
337
+              "--pidfile=$env:TEMP\docker.pid", `
338
+              "--register-service"
339
+          Write-Host "Starting service"
340
+          Start-Service -Name docker
341
+          Write-Host "Service started successfully!"
342
+      -
343
+        name: Waiting for test daemon to start
344
+        run: |
345
+          $tries=20
346
+          Write-Host "Waiting for the test daemon to start..."
347
+          While ($true) {
348
+            $ErrorActionPreference = "SilentlyContinue"
349
+            & "${{ env.BIN_OUT }}\docker" version
350
+            $ErrorActionPreference = "Stop"
351
+            If ($LastExitCode -eq 0) {
352
+              break
353
+            }
354
+            $tries--
355
+            If ($tries -le 0) {
356
+              Throw "Failed to get a response from the daemon"
357
+            }
358
+            Write-Host -NoNewline "."
359
+            Start-Sleep -Seconds 1
360
+          }
361
+          Write-Host "Test daemon started and replied!"
362
+        env:
363
+          DOCKER_HOST: npipe:////./pipe/docker_engine
364
+      -
365
+        name: Docker info
366
+        run: |
367
+          & "${{ env.BIN_OUT }}\docker" info
368
+        env:
369
+          DOCKER_HOST: npipe:////./pipe/docker_engine
370
+      -
371
+        name: Building contrib/busybox
372
+        run: |
373
+          & "${{ env.BIN_OUT }}\docker" build -t busybox `
374
+            --build-arg WINDOWS_BASE_IMAGE `
375
+            --build-arg WINDOWS_BASE_IMAGE_TAG `
376
+            .\contrib\busybox\
377
+        env:
378
+          DOCKER_HOST: npipe:////./pipe/docker_engine
379
+      -
380
+        name: List images
381
+        run: |
382
+          & "${{ env.BIN_OUT }}\docker" images
383
+        env:
384
+          DOCKER_HOST: npipe:////./pipe/docker_engine
385
+      -
386
+        name: Set up Go
387
+        uses: actions/setup-go@v3
388
+        with:
389
+          go-version: ${{ env.GO_VERSION }}
390
+      -
391
+        name: Test integration
392
+        if: matrix.test == './...'
393
+        run: |
394
+          .\hack\make.ps1 -TestIntegration
395
+        env:
396
+          DOCKER_HOST: npipe:////./pipe/docker_engine
397
+          GO111MODULE: "off"
398
+          TEST_CLIENT_BINARY: ${{ env.BIN_OUT }}\docker
399
+      -
400
+        name: Test integration-cli
401
+        if: matrix.test != './...'
402
+        run: |
403
+          .\hack\make.ps1 -TestIntegrationCli
404
+        env:
405
+          DOCKER_HOST: npipe:////./pipe/docker_engine
406
+          GO111MODULE: "off"
407
+          TEST_CLIENT_BINARY: ${{ env.BIN_OUT }}\docker
408
+          INTEGRATION_TESTRUN: ${{ matrix.test }}
409
+      -
410
+        name: Send to Codecov
411
+        if: inputs.send_coverage
412
+        uses: codecov/codecov-action@v3
413
+        with:
414
+          working-directory: ${{ env.GOPATH }}\src\github.com\docker\docker
415
+          directory: bundles
416
+          env_vars: RUNNER_OS
417
+          flags: integration,${{ matrix.runtime }}
418
+      -
419
+        name: Docker info
420
+        run: |
421
+          & "${{ env.BIN_OUT }}\docker" info
422
+        env:
423
+          DOCKER_HOST: npipe:////./pipe/docker_engine
424
+      -
425
+        name: Stop containerd
426
+        if: always() && matrix.runtime == 'containerd'
427
+        run: |
428
+          $ErrorActionPreference = "SilentlyContinue"
429
+          Stop-Service -Force -Name containerd
430
+          $ErrorActionPreference = "Stop"
431
+      -
432
+        name: Containerd logs
433
+        if: always() && matrix.runtime == 'containerd'
434
+        run: |
435
+          Copy-Item "$env:TEMP\ctn.log" -Destination ".\bundles\containerd.log"
436
+          Get-Content "$env:TEMP\ctn.log" | Out-Host
437
+      -
438
+        name: Stop daemon
439
+        if: always()
440
+        run: |
441
+          $ErrorActionPreference = "SilentlyContinue"
442
+          Stop-Service -Force -Name docker
443
+          $ErrorActionPreference = "Stop"
444
+      -
445
+        # as the daemon is registered as a service we have to check the event
446
+        # logs against the docker provider.
447
+        name: Daemon event logs
448
+        if: always()
449
+        run: |
450
+          Get-WinEvent -ea SilentlyContinue `
451
+            -FilterHashtable @{ProviderName= "docker"; LogName = "application"} |
452
+              Sort-Object @{Expression="TimeCreated";Descending=$false} |
453
+              ForEach-Object {"$($_.TimeCreated.ToUniversalTime().ToString("o")) [$($_.LevelDisplayName)] $($_.Message)"} |
454
+              Tee-Object -file ".\bundles\daemon.log"
455
+      -
456
+        name: Upload reports
457
+        if: always()
458
+        uses: actions/upload-artifact@v3
459
+        with:
460
+          name: ${{ inputs.os }}-integration-reports-${{ matrix.runtime }}
461
+          path: ${{ env.GOPATH }}\src\github.com\docker\docker\bundles\*
462
+
463
+  integration-test-report:
464
+    runs-on: ubuntu-latest
465
+    if: always()
466
+    needs:
467
+      - integration-test
468
+    strategy:
469
+      fail-fast: false
470
+      matrix:
471
+        runtime:
472
+          - builtin
473
+          - containerd
474
+    steps:
475
+      -
476
+        name: Set up Go
477
+        uses: actions/setup-go@v3
478
+        with:
479
+          go-version: ${{ env.GO_VERSION }}
480
+      -
481
+        name: Download artifacts
482
+        uses: actions/download-artifact@v3
483
+        with:
484
+          name: ${{ inputs.os }}-integration-reports-${{ matrix.runtime }}
485
+          path: /tmp/artifacts
486
+      -
487
+        name: Install teststat
488
+        run: |
489
+          go install github.com/vearutop/teststat@${{ env.TESTSTAT_VERSION }}
490
+      -
491
+        name: Create summary
492
+        run: |
493
+          teststat -markdown $(find /tmp/artifacts -type f -name '*.json' -print0 | xargs -0) >> $GITHUB_STEP_SUMMARY
0 494
new file mode 100644
... ...
@@ -0,0 +1,17 @@
0
+name: windows-2019
1
+
2
+concurrency:
3
+  group: ${{ github.workflow }}-${{ github.ref }}
4
+  cancel-in-progress: true
5
+
6
+on:
7
+  schedule:
8
+    - cron: '0 10 * * *'
9
+  workflow_dispatch:
10
+
11
+jobs:
12
+  run:
13
+    uses: ./.github/workflows/.windows.yml
14
+    with:
15
+      os: windows-2019
16
+      send_coverage: false
0 17
new file mode 100644
... ...
@@ -0,0 +1,20 @@
0
+name: windows-2022
1
+
2
+concurrency:
3
+  group: ${{ github.workflow }}-${{ github.ref }}
4
+  cancel-in-progress: true
5
+
6
+on:
7
+  workflow_dispatch:
8
+  push:
9
+    branches:
10
+      - 'master'
11
+      - '[0-9]+.[0-9]{2}'
12
+  pull_request:
13
+
14
+jobs:
15
+  run:
16
+    uses: ./.github/workflows/.windows.yml
17
+    with:
18
+      os: windows-2022
19
+      send_coverage: true
0 20
deleted file mode 100644
... ...
@@ -1,519 +0,0 @@
1
-name: windows
2
-
3
-concurrency:
4
-  group: ${{ github.workflow }}-${{ github.ref }}
5
-  cancel-in-progress: true
6
-
7
-on:
8
-  workflow_dispatch:
9
-  push:
10
-    branches:
11
-      - 'master'
12
-      - '[0-9]+.[0-9]{2}'
13
-    tags:
14
-      - 'v*'
15
-  pull_request:
16
-
17
-env:
18
-  GO_VERSION: 1.18.5
19
-  GOTESTLIST_VERSION: v0.2.0
20
-  TESTSTAT_VERSION: v0.1.3
21
-  WINDOWS_BASE_IMAGE: mcr.microsoft.com/windows/servercore
22
-  WINDOWS_BASE_TAG_2019: ltsc2019
23
-  WINDOWS_BASE_TAG_2022: ltsc2022
24
-  TEST_IMAGE_NAME: moby:test
25
-  TEST_CTN_NAME: moby
26
-  DOCKER_BUILDKIT: 0
27
-
28
-jobs:
29
-  build:
30
-    runs-on: ${{ matrix.os }}
31
-    strategy:
32
-      fail-fast: false
33
-      matrix:
34
-        os:
35
-          - windows-2019
36
-          - windows-2022
37
-    env:
38
-      GOPATH: ${{ github.workspace }}\go
39
-      GOBIN: ${{ github.workspace }}\go\bin
40
-      BIN_OUT: ${{ github.workspace }}\out
41
-    defaults:
42
-      run:
43
-        working-directory: ${{ env.GOPATH }}/src/github.com/docker/docker
44
-    steps:
45
-      -
46
-        name: Checkout
47
-        uses: actions/checkout@v3
48
-        with:
49
-          path: ${{ env.GOPATH }}/src/github.com/docker/docker
50
-      -
51
-        name: Env
52
-        run: |
53
-          Get-ChildItem Env: | Out-String
54
-      -
55
-        name: Init
56
-        run: |
57
-          New-Item -ItemType "directory" -Path "${{ github.workspace }}\go-build"
58
-          New-Item -ItemType "directory" -Path "${{ github.workspace }}\go\pkg\mod"
59
-          If ("${{ matrix.os }}" -eq "windows-2019") {
60
-            echo "WINDOWS_BASE_IMAGE_TAG=${{ env.WINDOWS_BASE_TAG_2019 }}" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
61
-          } ElseIf ("${{ matrix.os }}" -eq "windows-2022") {
62
-            echo "WINDOWS_BASE_IMAGE_TAG=${{ env.WINDOWS_BASE_TAG_2022 }}" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
63
-          }
64
-      -
65
-        name: Cache
66
-        uses: actions/cache@v3
67
-        with:
68
-          path: |
69
-            ~\AppData\Local\go-build
70
-            ~\go\pkg\mod
71
-            ${{ github.workspace }}\go-build
72
-            ${{ env.GOPATH }}\pkg\mod
73
-          key: ${{ matrix.os }}-${{ github.job }}-${{ hashFiles('**/vendor.sum') }}
74
-          restore-keys: |
75
-            ${{ matrix.os }}-${{ github.job }}-
76
-      -
77
-        name: Docker info
78
-        run: |
79
-          docker info
80
-      -
81
-        name: Build base image
82
-        run: |
83
-          docker pull ${{ env.WINDOWS_BASE_IMAGE }}:${{ env.WINDOWS_BASE_IMAGE_TAG }}
84
-          docker tag ${{ env.WINDOWS_BASE_IMAGE }}:${{ env.WINDOWS_BASE_IMAGE_TAG }} microsoft/windowsservercore
85
-          docker build --build-arg GO_VERSION -t ${{ env.TEST_IMAGE_NAME }} -f Dockerfile.windows .
86
-      -
87
-        name: Build binaries
88
-        run: |
89
-          & docker run --name ${{ env.TEST_CTN_NAME }} -e "DOCKER_GITCOMMIT=${{ github.sha }}" `
90
-              -v "${{ github.workspace }}\go-build:C:\Users\ContainerAdministrator\AppData\Local\go-build" `
91
-              -v "${{ github.workspace }}\go\pkg\mod:C:\gopath\pkg\mod" `
92
-              ${{ env.TEST_IMAGE_NAME }} hack\make.ps1 -Daemon -Client
93
-      -
94
-        name: Copy artifacts
95
-        run: |
96
-          New-Item -ItemType "directory" -Path "${{ env.BIN_OUT }}"
97
-          docker cp "${{ env.TEST_CTN_NAME }}`:c`:\gopath\src\github.com\docker\docker\bundles\docker.exe" ${{ env.BIN_OUT }}\
98
-          docker cp "${{ env.TEST_CTN_NAME }}`:c`:\gopath\src\github.com\docker\docker\bundles\dockerd.exe" ${{ env.BIN_OUT }}\
99
-          docker cp "${{ env.TEST_CTN_NAME }}`:c`:\gopath\bin\gotestsum.exe" ${{ env.BIN_OUT }}\
100
-          docker cp "${{ env.TEST_CTN_NAME }}`:c`:\containerd\bin\containerd.exe" ${{ env.BIN_OUT }}\
101
-          docker cp "${{ env.TEST_CTN_NAME }}`:c`:\containerd\bin\containerd-shim-runhcs-v1.exe" ${{ env.BIN_OUT }}\
102
-      -
103
-        name: Upload artifacts
104
-        uses: actions/upload-artifact@v3
105
-        with:
106
-          name: build-${{ matrix.os }}
107
-          path: ${{ env.BIN_OUT }}/*
108
-          if-no-files-found: error
109
-          retention-days: 2
110
-
111
-  unit-test:
112
-    runs-on: ${{ matrix.os }}
113
-    strategy:
114
-      fail-fast: false
115
-      matrix:
116
-        os:
117
-          - windows-2019
118
-          - windows-2022
119
-    env:
120
-      GOPATH: ${{ github.workspace }}\go
121
-      GOBIN: ${{ github.workspace }}\go\bin
122
-    defaults:
123
-      run:
124
-        working-directory: ${{ env.GOPATH }}/src/github.com/docker/docker
125
-    steps:
126
-      -
127
-        name: Checkout
128
-        uses: actions/checkout@v3
129
-        with:
130
-          path: ${{ env.GOPATH }}/src/github.com/docker/docker
131
-      -
132
-        name: Env
133
-        run: |
134
-          Get-ChildItem Env: | Out-String
135
-      -
136
-        name: Init
137
-        run: |
138
-          New-Item -ItemType "directory" -Path "${{ github.workspace }}\go-build"
139
-          New-Item -ItemType "directory" -Path "${{ github.workspace }}\go\pkg\mod"
140
-          New-Item -ItemType "directory" -Path "bundles"
141
-          If ("${{ matrix.os }}" -eq "windows-2019") {
142
-            echo "WINDOWS_BASE_IMAGE_TAG=${{ env.WINDOWS_BASE_TAG_2019 }}" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
143
-          } ElseIf ("${{ matrix.os }}" -eq "windows-2022") {
144
-            echo "WINDOWS_BASE_IMAGE_TAG=${{ env.WINDOWS_BASE_TAG_2022 }}" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
145
-          }
146
-      -
147
-        name: Cache
148
-        uses: actions/cache@v3
149
-        with:
150
-          path: |
151
-            ~\AppData\Local\go-build
152
-            ~\go\pkg\mod
153
-            ${{ github.workspace }}\go-build
154
-            ${{ env.GOPATH }}\pkg\mod
155
-          key: ${{ matrix.os }}-${{ github.job }}-${{ hashFiles('**/vendor.sum') }}
156
-          restore-keys: |
157
-            ${{ matrix.os }}-${{ github.job }}-
158
-      -
159
-        name: Docker info
160
-        run: |
161
-          docker info
162
-      -
163
-        name: Build base image
164
-        run: |
165
-          docker pull ${{ env.WINDOWS_BASE_IMAGE }}:${{ env.WINDOWS_BASE_IMAGE_TAG }}
166
-          docker tag ${{ env.WINDOWS_BASE_IMAGE }}:${{ env.WINDOWS_BASE_IMAGE_TAG }} microsoft/windowsservercore
167
-          docker build --build-arg GO_VERSION -t ${{ env.TEST_IMAGE_NAME }} -f Dockerfile.windows .
168
-      -
169
-        name: Test
170
-        run: |
171
-          & docker run --name ${{ env.TEST_CTN_NAME }} -e "DOCKER_GITCOMMIT=${{ github.sha }}" `
172
-            -v "${{ github.workspace }}\go-build:C:\Users\ContainerAdministrator\AppData\Local\go-build" `
173
-            -v "${{ github.workspace }}\go\pkg\mod:C:\gopath\pkg\mod" `
174
-            -v "${{ env.GOPATH }}\src\github.com\docker\docker\bundles:C:\gopath\src\github.com\docker\docker\bundles" `
175
-            ${{ env.TEST_IMAGE_NAME }} hack\make.ps1 -TestUnit
176
-      -
177
-        name: Send to Codecov
178
-        if: matrix.os == 'windows-2022'
179
-        uses: codecov/codecov-action@v3
180
-        with:
181
-          working-directory: ${{ env.GOPATH }}\src\github.com\docker\docker
182
-          directory: bundles
183
-          env_vars: RUNNER_OS
184
-          flags: unit
185
-      -
186
-        name: Upload reports
187
-        if: always()
188
-        uses: actions/upload-artifact@v3
189
-        with:
190
-          name: ${{ matrix.os }}-unit-reports
191
-          path: ${{ env.GOPATH }}\src\github.com\docker\docker\bundles\*
192
-
193
-  unit-test-report:
194
-    runs-on: ubuntu-latest
195
-    if: always()
196
-    needs:
197
-      - unit-test
198
-    strategy:
199
-      fail-fast: false
200
-      matrix:
201
-        os:
202
-          - windows-2019
203
-          - windows-2022
204
-    steps:
205
-      -
206
-        name: Set up Go
207
-        uses: actions/setup-go@v3
208
-        with:
209
-          go-version: ${{ env.GO_VERSION }}
210
-      -
211
-        name: Download artifacts
212
-        uses: actions/download-artifact@v3
213
-        with:
214
-          name: ${{ matrix.os }}-unit-reports
215
-          path: /tmp/artifacts
216
-      -
217
-        name: Install teststat
218
-        run: |
219
-          go install github.com/vearutop/teststat@${{ env.TESTSTAT_VERSION }}
220
-      -
221
-        name: Create summary
222
-        run: |
223
-          teststat -markdown $(find /tmp/artifacts -type f -name '*.json' -print0 | xargs -0) >> $GITHUB_STEP_SUMMARY
224
-
225
-  integration-test-prepare:
226
-    runs-on: ubuntu-latest
227
-    outputs:
228
-      matrix: ${{ steps.tests.outputs.matrix }}
229
-    steps:
230
-      -
231
-        name: Checkout
232
-        uses: actions/checkout@v3
233
-      -
234
-        name: Set up Go
235
-        uses: actions/setup-go@v3
236
-        with:
237
-          go-version: ${{ env.GO_VERSION }}
238
-      -
239
-        name: Install gotestlist
240
-        run:
241
-          go install github.com/crazy-max/gotestlist/cmd/gotestlist@${{ env.GOTESTLIST_VERSION }}
242
-      -
243
-        name: Create matrix
244
-        id: tests
245
-        working-directory: ./integration-cli
246
-        run: |
247
-          # Distribute integration-cli tests for the matrix in integration-test job.
248
-          # Also prepend ./... to the matrix. This is a special case to run "Test integration" step exclusively.
249
-          matrix="$(gotestlist -d 4 ./...)"
250
-          matrix="$(echo "$matrix" | jq -c '. |= ["./..."] + .')"
251
-          echo "::set-output name=matrix::$matrix"
252
-      -
253
-        name: Show matrix
254
-        run: |
255
-          echo ${{ steps.tests.outputs.matrix }}
256
-
257
-  integration-test:
258
-    runs-on: ${{ matrix.os }}
259
-    needs:
260
-      - build
261
-      - integration-test-prepare
262
-    strategy:
263
-      fail-fast: false
264
-      matrix:
265
-        os:
266
-          - windows-2019
267
-          - windows-2022
268
-        runtime:
269
-          - builtin
270
-          - containerd
271
-        test: ${{ fromJson(needs.integration-test-prepare.outputs.matrix) }}
272
-    env:
273
-      GOPATH: ${{ github.workspace }}\go
274
-      GOBIN: ${{ github.workspace }}\go\bin
275
-      BIN_OUT: ${{ github.workspace }}\out
276
-    defaults:
277
-      run:
278
-        working-directory: ${{ env.GOPATH }}/src/github.com/docker/docker
279
-    steps:
280
-      -
281
-        name: Checkout
282
-        uses: actions/checkout@v3
283
-        with:
284
-          path: ${{ env.GOPATH }}/src/github.com/docker/docker
285
-      -
286
-        name: Env
287
-        run: |
288
-          Get-ChildItem Env: | Out-String
289
-      -
290
-        name: Download artifacts
291
-        uses: actions/download-artifact@v3
292
-        with:
293
-          name: build-${{ matrix.os }}
294
-          path: ${{ env.BIN_OUT }}
295
-      -
296
-        name: Init
297
-        run: |
298
-          New-Item -ItemType "directory" -Path "bundles"
299
-          If ("${{ matrix.os }}" -eq "windows-2019") {
300
-            echo "WINDOWS_BASE_IMAGE_TAG=${{ env.WINDOWS_BASE_TAG_2019 }}" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
301
-          } ElseIf ("${{ matrix.os }}" -eq "windows-2022") {
302
-            echo "WINDOWS_BASE_IMAGE_TAG=${{ env.WINDOWS_BASE_TAG_2022 }}" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
303
-          }
304
-          Write-Output "${{ env.BIN_OUT }}" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
305
-      -
306
-        # removes docker service that is currently installed on the runner. we
307
-        # could use Uninstall-Package but not yet available on Windows runners.
308
-        # more info: https://github.com/actions/virtual-environments/blob/d3a5bad25f3b4326c5666bab0011ac7f1beec95e/images/win/scripts/Installers/Install-Docker.ps1#L11
309
-        name: Removing current daemon
310
-        run: |
311
-          if (Get-Service docker -ErrorAction SilentlyContinue) {
312
-            $dockerVersion = (docker version -f "{{.Server.Version}}")
313
-            Write-Host "Current installed Docker version: $dockerVersion"
314
-            # remove service
315
-            Stop-Service -Force -Name docker
316
-            Remove-Service -Name docker
317
-            # removes event log entry. we could use "Remove-EventLog -LogName -Source docker"
318
-            # but this cmd is only available since windows-2022
319
-            $ErrorActionPreference = "SilentlyContinue"
320
-            & reg delete "HKLM\SYSTEM\CurrentControlSet\Services\EventLog\Application\docker" /f 2>&1 | Out-Null
321
-            $ErrorActionPreference = "Stop"
322
-            Write-Host "Service removed"
323
-          }
324
-      -
325
-        name: Starting containerd
326
-        if: matrix.runtime == 'containerd'
327
-        run: |
328
-          Write-Host "Generating config"
329
-          & "${{ env.BIN_OUT }}\containerd.exe" config default | Out-File "$env:TEMP\ctn.toml" -Encoding ascii
330
-          Write-Host "Creating service"
331
-          New-Item -ItemType Directory "$env:TEMP\ctn-root" -ErrorAction SilentlyContinue | Out-Null
332
-          New-Item -ItemType Directory "$env:TEMP\ctn-state" -ErrorAction SilentlyContinue | Out-Null
333
-          Start-Process -Wait "${{ env.BIN_OUT }}\containerd.exe" `
334
-            -ArgumentList "--log-level=debug", `
335
-              "--config=$env:TEMP\ctn.toml", `
336
-              "--address=\\.\pipe\containerd-containerd", `
337
-              "--root=$env:TEMP\ctn-root", `
338
-              "--state=$env:TEMP\ctn-state", `
339
-              "--log-file=$env:TEMP\ctn.log", `
340
-              "--register-service"
341
-          Write-Host "Starting service"
342
-          Start-Service -Name containerd
343
-          Start-Sleep -Seconds 5
344
-          Write-Host "Service started successfully!"
345
-      -
346
-        name: Starting test daemon
347
-        run: |
348
-          Write-Host "Creating service"
349
-          If ("${{ matrix.runtime }}" -eq "containerd") {
350
-            $runtimeArg="--containerd=\\.\pipe\containerd-containerd"
351
-            echo "DOCKER_WINDOWS_CONTAINERD_RUNTIME=1" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
352
-          }
353
-          New-Item -ItemType Directory "$env:TEMP\moby-root" -ErrorAction SilentlyContinue | Out-Null
354
-          New-Item -ItemType Directory "$env:TEMP\moby-exec" -ErrorAction SilentlyContinue | Out-Null
355
-          Start-Process -Wait -NoNewWindow "${{ env.BIN_OUT }}\dockerd" `
356
-            -ArgumentList $runtimeArg, "--debug", `
357
-              "--host=npipe:////./pipe/docker_engine", `
358
-              "--data-root=$env:TEMP\moby-root", `
359
-              "--exec-root=$env:TEMP\moby-exec", `
360
-              "--pidfile=$env:TEMP\docker.pid", `
361
-              "--register-service"
362
-          Write-Host "Starting service"
363
-          Start-Service -Name docker
364
-          Write-Host "Service started successfully!"
365
-      -
366
-        name: Waiting for test daemon to start
367
-        run: |
368
-          $tries=20
369
-          Write-Host "Waiting for the test daemon to start..."
370
-          While ($true) {
371
-            $ErrorActionPreference = "SilentlyContinue"
372
-            & "${{ env.BIN_OUT }}\docker" version
373
-            $ErrorActionPreference = "Stop"
374
-            If ($LastExitCode -eq 0) {
375
-              break
376
-            }
377
-            $tries--
378
-            If ($tries -le 0) {
379
-              Throw "Failed to get a response from the daemon"
380
-            }
381
-            Write-Host -NoNewline "."
382
-            Start-Sleep -Seconds 1
383
-          }
384
-          Write-Host "Test daemon started and replied!"
385
-        env:
386
-          DOCKER_HOST: npipe:////./pipe/docker_engine
387
-      -
388
-        name: Docker info
389
-        run: |
390
-          & "${{ env.BIN_OUT }}\docker" info
391
-        env:
392
-          DOCKER_HOST: npipe:////./pipe/docker_engine
393
-      -
394
-        name: Building contrib/busybox
395
-        run: |
396
-          & "${{ env.BIN_OUT }}\docker" build -t busybox `
397
-            --build-arg WINDOWS_BASE_IMAGE `
398
-            --build-arg WINDOWS_BASE_IMAGE_TAG `
399
-            .\contrib\busybox\
400
-        env:
401
-          DOCKER_HOST: npipe:////./pipe/docker_engine
402
-      -
403
-        name: List images
404
-        run: |
405
-          & "${{ env.BIN_OUT }}\docker" images
406
-        env:
407
-          DOCKER_HOST: npipe:////./pipe/docker_engine
408
-      -
409
-        name: Set up Go
410
-        uses: actions/setup-go@v3
411
-        with:
412
-          go-version: ${{ env.GO_VERSION }}
413
-      -
414
-        name: Test integration
415
-        if: matrix.test == './...'
416
-        run: |
417
-          .\hack\make.ps1 -TestIntegration
418
-        env:
419
-          DOCKER_HOST: npipe:////./pipe/docker_engine
420
-          GO111MODULE: "off"
421
-          TEST_CLIENT_BINARY: ${{ env.BIN_OUT }}\docker
422
-      -
423
-        name: Test integration-cli
424
-        if: matrix.test != './...'
425
-        run: |
426
-          .\hack\make.ps1 -TestIntegrationCli
427
-        env:
428
-          DOCKER_HOST: npipe:////./pipe/docker_engine
429
-          GO111MODULE: "off"
430
-          TEST_CLIENT_BINARY: ${{ env.BIN_OUT }}\docker
431
-          INTEGRATION_TESTRUN: ${{ matrix.test }}
432
-      -
433
-        name: Send to Codecov
434
-        if: matrix.os == 'windows-2022'
435
-        uses: codecov/codecov-action@v3
436
-        with:
437
-          working-directory: ${{ env.GOPATH }}\src\github.com\docker\docker
438
-          directory: bundles
439
-          env_vars: RUNNER_OS
440
-          flags: integration,${{ matrix.runtime }}
441
-      -
442
-        name: Docker info
443
-        run: |
444
-          & "${{ env.BIN_OUT }}\docker" info
445
-        env:
446
-          DOCKER_HOST: npipe:////./pipe/docker_engine
447
-      -
448
-        name: Stop containerd
449
-        if: always() && matrix.runtime == 'containerd'
450
-        run: |
451
-          $ErrorActionPreference = "SilentlyContinue"
452
-          Stop-Service -Force -Name containerd
453
-          $ErrorActionPreference = "Stop"
454
-      -
455
-        name: Containerd logs
456
-        if: always() && matrix.runtime == 'containerd'
457
-        run: |
458
-          Copy-Item "$env:TEMP\ctn.log" -Destination ".\bundles\containerd.log"
459
-          Get-Content "$env:TEMP\ctn.log" | Out-Host
460
-      -
461
-        name: Stop daemon
462
-        if: always()
463
-        run: |
464
-          $ErrorActionPreference = "SilentlyContinue"
465
-          Stop-Service -Force -Name docker
466
-          $ErrorActionPreference = "Stop"
467
-      -
468
-        # as the daemon is registered as a service we have to check the event
469
-        # logs against the docker provider.
470
-        name: Daemon event logs
471
-        if: always()
472
-        run: |
473
-          Get-WinEvent -ea SilentlyContinue `
474
-            -FilterHashtable @{ProviderName= "docker"; LogName = "application"} |
475
-              Sort-Object @{Expression="TimeCreated";Descending=$false} |
476
-              ForEach-Object {"$($_.TimeCreated.ToUniversalTime().ToString("o")) [$($_.LevelDisplayName)] $($_.Message)"} |
477
-              Tee-Object -file ".\bundles\daemon.log"
478
-      -
479
-        name: Upload reports
480
-        if: always()
481
-        uses: actions/upload-artifact@v3
482
-        with:
483
-          name: ${{ matrix.os }}-integration-reports-${{ matrix.runtime }}
484
-          path: ${{ env.GOPATH }}\src\github.com\docker\docker\bundles\*
485
-
486
-  integration-test-report:
487
-    runs-on: ubuntu-latest
488
-    if: always()
489
-    needs:
490
-      - integration-test
491
-    strategy:
492
-      fail-fast: false
493
-      matrix:
494
-        os:
495
-          - windows-2019
496
-          - windows-2022
497
-        runtime:
498
-          - builtin
499
-          - containerd
500
-    steps:
501
-      -
502
-        name: Set up Go
503
-        uses: actions/setup-go@v3
504
-        with:
505
-          go-version: ${{ env.GO_VERSION }}
506
-      -
507
-        name: Download artifacts
508
-        uses: actions/download-artifact@v3
509
-        with:
510
-          name: ${{ matrix.os }}-integration-reports-${{ matrix.runtime }}
511
-          path: /tmp/artifacts
512
-      -
513
-        name: Install teststat
514
-        run: |
515
-          go install github.com/vearutop/teststat@${{ env.TESTSTAT_VERSION }}
516
-      -
517
-        name: Create summary
518
-        run: |
519
-          teststat -markdown $(find /tmp/artifacts -type f -name '*.json' -print0 | xargs -0) >> $GITHUB_STEP_SUMMARY
... ...
@@ -155,7 +155,7 @@
155 155
 # The number of build steps below are explicitly minimised to improve performance.
156 156
 
157 157
 # Extremely important - do not change the following line to reference a "specific" image, 
158
-# such as `mcr.microsoft.com/windows/servercore:ltsc2019`. If using this Dockerfile in process
158
+# such as `mcr.microsoft.com/windows/servercore:ltsc2022`. If using this Dockerfile in process
159 159
 # isolated containers, the kernel of the host must match the container image, and hence
160 160
 # would fail between Windows Server 2016 (aka RS1) and Windows Server 2019 (aka RS5).
161 161
 # It is expected that the image `microsoft/windowsservercore:latest` is present, and matches
... ...
@@ -9,7 +9,7 @@
9 9
 # To build: docker build -t busybox .
10 10
 # To publish: Needs someone with publishing rights
11 11
 ARG WINDOWS_BASE_IMAGE=mcr.microsoft.com/windows/servercore
12
-ARG WINDOWS_BASE_IMAGE_TAG=ltsc2019
12
+ARG WINDOWS_BASE_IMAGE_TAG=ltsc2022
13 13
 ARG BUSYBOX_VERSION=FRP-3329-gcf0fa4d13
14 14
 
15 15
 # Checksum taken from https://frippery.org/files/busybox/SHA256SUM
... ...
@@ -284,6 +284,6 @@ func (s *DockerCLIPullSuite) TestPullLinuxImageFailsOnWindows(c *testing.T) {
284 284
 // Regression test for https://github.com/docker/docker/issues/28892
285 285
 func (s *DockerCLIPullSuite) TestPullWindowsImageFailsOnLinux(c *testing.T) {
286 286
 	testRequires(c, DaemonIsLinux, Network)
287
-	_, _, err := dockerCmdWithError("pull", "mcr.microsoft.com/windows/servercore:ltsc2019")
287
+	_, _, err := dockerCmdWithError("pull", "mcr.microsoft.com/windows/servercore:ltsc2022")
288 288
 	assert.ErrorContains(c, err, "no matching manifest for linux")
289 289
 }