forked from moby/buildkit
-
Notifications
You must be signed in to change notification settings - Fork 0
134 lines (130 loc) · 3.71 KB
/
dockerd.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
name: dockerd
on:
# TODO: add event to build on command in PR (e.g., /test-dockerd)
workflow_dispatch:
inputs:
version:
description: 'Docker version'
required: true
default: '25.0.2'
env:
SETUP_BUILDX_VERSION: "latest"
SETUP_BUILDKIT_IMAGE: "moby/buildkit:latest"
TESTFLAGS: "-v --parallel=1 --timeout=30m"
jobs:
prepare:
runs-on: ubuntu-24.04
steps:
-
name: Prepare
uses: actions/github-script@v7
with:
script: |
const version = `${{ inputs.version }}` || '25.0.2';
let build = 'true';
try {
new URL(version);
} catch (e) {
build = 'false';
}
core.exportVariable('DOCKER_VERSION', version);
core.exportVariable('DOCKER_BUILD', build);
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
version: ${{ env.SETUP_BUILDX_VERSION }}
driver-opts: image=${{ env.SETUP_BUILDKIT_IMAGE }}
buildkitd-flags: --debug
-
name: Build
if: ${{ env.DOCKER_BUILD == 'true' }}
uses: docker/build-push-action@v6
with:
context: ${{ env.DOCKER_VERSION }}
target: binary
outputs: /tmp/moby
-
name: Rename binary
if: ${{ env.DOCKER_BUILD == 'true' }}
run: |
if [ -L "/tmp/moby/binary-daemon/dockerd" ]; then
mv -f $(readlink /tmp/moby/binary-daemon/dockerd) /tmp/moby/dockerd
fi
-
name: Download
if: ${{ env.DOCKER_BUILD != 'true' }}
run: |
mkdir -p /tmp/moby
cd /tmp/moby
wget -qO- "https://download.docker.com/linux/static/stable/x86_64/docker-${{ env.DOCKER_VERSION }}.tgz" | tar xvz --strip 1
-
name: Upload dockerd
uses: actions/upload-artifact@v4
with:
name: dockerd
path: /tmp/moby/dockerd
if-no-files-found: error
retention-days: 1
test:
runs-on: ubuntu-24.04
needs:
- prepare
strategy:
fail-fast: false
matrix:
worker:
- dockerd
- dockerd-containerd
pkg:
- ./client
- ./cmd/buildctl
- ./solver
- ./frontend
- ./frontend/dockerfile
typ:
- integration
include:
- pkg: ./...
skip-integration-tests: 1
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Expose GitHub Runtime
uses: crazy-max/ghaction-github-runtime@v3
-
name: Set up QEMU
uses: docker/setup-qemu-action@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
version: ${{ env.SETUP_BUILDX_VERSION }}
driver-opts: image=${{ env.SETUP_BUILDKIT_IMAGE }}
buildkitd-flags: --debug
-
name: Download dockerd
uses: actions/download-artifact@v4
with:
name: dockerd
path: ./build/
-
name: Fix dockerd perms
run: |
chmod +x ./build/dockerd
-
name: Test
run: |
./hack/test ${{ matrix.typ }}
env:
TEST_DOCKERD: "1"
TEST_DOCKERD_BINARY: "./build/dockerd"
TESTPKGS: "${{ matrix.pkg }}"
TESTFLAGS: "${{ env.TESTFLAGS }} --run=//worker=${{ matrix.worker }}$"
SKIP_INTEGRATION_TESTS: "${{ matrix.skip-integration-tests }}"
CACHE_FROM: "type=gha,scope=build-integration-tests"
BUILDKIT_INTEGRATION_DOCKERD_FLAGS: |
--bip=10.66.66.1/24
--default-address-pool=base=10.66.66.0/16,size=24