Compare commits

..

12 Commits

Author SHA1 Message Date
CrazyMax
e9cfd63e16 Merge pull request #67 from docker/bot/buildx-releases-json
Some checks failed
publish / publish (push) Has been cancelled
Update `.github/buildx-releases.json`
2023-03-07 10:07:18 +01:00
crazy-max
ac61bd8949 github: update .github/buildx-releases.json
Signed-off-by: GitHub <noreply@github.com>
2023-03-07 00:18:02 +00:00
CrazyMax
dd1544e1be Merge pull request #64 from crazy-max/builder-exists
builder: exists method
2023-03-03 15:24:01 +01:00
CrazyMax
32af66cb28 builder: exists method
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2023-03-03 14:49:22 +01:00
CrazyMax
2090433c0d Merge pull request #63 from crazy-max/docker-latest
docker: support latest on install
2023-03-03 14:15:40 +01:00
CrazyMax
50c11e6dce docker: support latest on install
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2023-03-03 14:07:27 +01:00
CrazyMax
0f9cc7c29f Merge pull request #62 from crazy-max/docker-custom-context
docker: allow custom context name on install
2023-03-03 14:00:23 +01:00
CrazyMax
dfc72fd31c docker: allow custom context name on install
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2023-03-03 10:40:00 +01:00
CrazyMax
317ef51ab5 Merge pull request #60 from docker/bot/docker-releases-json
Update `.github/docker-releases.json`
2023-03-03 10:37:21 +01:00
crazy-max
3a30337d24 github: update .github/docker-releases.json
Signed-off-by: GitHub <noreply@github.com>
2023-03-03 09:36:41 +00:00
CrazyMax
fc16ecda91 Merge pull request #59 from crazy-max/docker-releases
ci: generate docker-releases.json
2023-03-03 10:36:10 +01:00
CrazyMax
48cefc1da0 ci: generate docker-releases.json
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2023-03-02 19:16:57 +01:00
13 changed files with 1042 additions and 98 deletions

View File

@@ -1,43 +1,84 @@
{
"latest": {
"id": 92694870,
"tag_name": "v0.10.3",
"html_url": "https://github.com/docker/buildx/releases/tag/v0.10.3",
"id": 94659464,
"tag_name": "v0.10.4",
"html_url": "https://github.com/docker/buildx/releases/tag/v0.10.4",
"assets": [
"https://github.com/docker/buildx/releases/download/v0.10.3/buildx-v0.10.3.darwin-amd64",
"https://github.com/docker/buildx/releases/download/v0.10.3/buildx-v0.10.3.darwin-amd64.provenance.json",
"https://github.com/docker/buildx/releases/download/v0.10.3/buildx-v0.10.3.darwin-amd64.sbom.json",
"https://github.com/docker/buildx/releases/download/v0.10.3/buildx-v0.10.3.darwin-arm64",
"https://github.com/docker/buildx/releases/download/v0.10.3/buildx-v0.10.3.darwin-arm64.provenance.json",
"https://github.com/docker/buildx/releases/download/v0.10.3/buildx-v0.10.3.darwin-arm64.sbom.json",
"https://github.com/docker/buildx/releases/download/v0.10.3/buildx-v0.10.3.linux-amd64",
"https://github.com/docker/buildx/releases/download/v0.10.3/buildx-v0.10.3.linux-amd64.provenance.json",
"https://github.com/docker/buildx/releases/download/v0.10.3/buildx-v0.10.3.linux-amd64.sbom.json",
"https://github.com/docker/buildx/releases/download/v0.10.3/buildx-v0.10.3.linux-arm-v6",
"https://github.com/docker/buildx/releases/download/v0.10.3/buildx-v0.10.3.linux-arm-v6.provenance.json",
"https://github.com/docker/buildx/releases/download/v0.10.3/buildx-v0.10.3.linux-arm-v6.sbom.json",
"https://github.com/docker/buildx/releases/download/v0.10.3/buildx-v0.10.3.linux-arm-v7",
"https://github.com/docker/buildx/releases/download/v0.10.3/buildx-v0.10.3.linux-arm-v7.provenance.json",
"https://github.com/docker/buildx/releases/download/v0.10.3/buildx-v0.10.3.linux-arm-v7.sbom.json",
"https://github.com/docker/buildx/releases/download/v0.10.3/buildx-v0.10.3.linux-arm64",
"https://github.com/docker/buildx/releases/download/v0.10.3/buildx-v0.10.3.linux-arm64.provenance.json",
"https://github.com/docker/buildx/releases/download/v0.10.3/buildx-v0.10.3.linux-arm64.sbom.json",
"https://github.com/docker/buildx/releases/download/v0.10.3/buildx-v0.10.3.linux-ppc64le",
"https://github.com/docker/buildx/releases/download/v0.10.3/buildx-v0.10.3.linux-ppc64le.provenance.json",
"https://github.com/docker/buildx/releases/download/v0.10.3/buildx-v0.10.3.linux-ppc64le.sbom.json",
"https://github.com/docker/buildx/releases/download/v0.10.3/buildx-v0.10.3.linux-riscv64",
"https://github.com/docker/buildx/releases/download/v0.10.3/buildx-v0.10.3.linux-riscv64.provenance.json",
"https://github.com/docker/buildx/releases/download/v0.10.3/buildx-v0.10.3.linux-riscv64.sbom.json",
"https://github.com/docker/buildx/releases/download/v0.10.3/buildx-v0.10.3.linux-s390x",
"https://github.com/docker/buildx/releases/download/v0.10.3/buildx-v0.10.3.linux-s390x.provenance.json",
"https://github.com/docker/buildx/releases/download/v0.10.3/buildx-v0.10.3.linux-s390x.sbom.json",
"https://github.com/docker/buildx/releases/download/v0.10.3/buildx-v0.10.3.windows-amd64.exe",
"https://github.com/docker/buildx/releases/download/v0.10.3/buildx-v0.10.3.windows-amd64.provenance.json",
"https://github.com/docker/buildx/releases/download/v0.10.3/buildx-v0.10.3.windows-amd64.sbom.json",
"https://github.com/docker/buildx/releases/download/v0.10.3/buildx-v0.10.3.windows-arm64.exe",
"https://github.com/docker/buildx/releases/download/v0.10.3/buildx-v0.10.3.windows-arm64.provenance.json",
"https://github.com/docker/buildx/releases/download/v0.10.3/buildx-v0.10.3.windows-arm64.sbom.json",
"https://github.com/docker/buildx/releases/download/v0.10.3/checksums.txt"
"https://github.com/docker/buildx/releases/download/v0.10.4/buildx-v0.10.4.darwin-amd64",
"https://github.com/docker/buildx/releases/download/v0.10.4/buildx-v0.10.4.darwin-amd64.provenance.json",
"https://github.com/docker/buildx/releases/download/v0.10.4/buildx-v0.10.4.darwin-amd64.sbom.json",
"https://github.com/docker/buildx/releases/download/v0.10.4/buildx-v0.10.4.darwin-arm64",
"https://github.com/docker/buildx/releases/download/v0.10.4/buildx-v0.10.4.darwin-arm64.provenance.json",
"https://github.com/docker/buildx/releases/download/v0.10.4/buildx-v0.10.4.darwin-arm64.sbom.json",
"https://github.com/docker/buildx/releases/download/v0.10.4/buildx-v0.10.4.linux-amd64",
"https://github.com/docker/buildx/releases/download/v0.10.4/buildx-v0.10.4.linux-amd64.provenance.json",
"https://github.com/docker/buildx/releases/download/v0.10.4/buildx-v0.10.4.linux-amd64.sbom.json",
"https://github.com/docker/buildx/releases/download/v0.10.4/buildx-v0.10.4.linux-arm-v6",
"https://github.com/docker/buildx/releases/download/v0.10.4/buildx-v0.10.4.linux-arm-v6.provenance.json",
"https://github.com/docker/buildx/releases/download/v0.10.4/buildx-v0.10.4.linux-arm-v6.sbom.json",
"https://github.com/docker/buildx/releases/download/v0.10.4/buildx-v0.10.4.linux-arm-v7",
"https://github.com/docker/buildx/releases/download/v0.10.4/buildx-v0.10.4.linux-arm-v7.provenance.json",
"https://github.com/docker/buildx/releases/download/v0.10.4/buildx-v0.10.4.linux-arm-v7.sbom.json",
"https://github.com/docker/buildx/releases/download/v0.10.4/buildx-v0.10.4.linux-arm64",
"https://github.com/docker/buildx/releases/download/v0.10.4/buildx-v0.10.4.linux-arm64.provenance.json",
"https://github.com/docker/buildx/releases/download/v0.10.4/buildx-v0.10.4.linux-arm64.sbom.json",
"https://github.com/docker/buildx/releases/download/v0.10.4/buildx-v0.10.4.linux-ppc64le",
"https://github.com/docker/buildx/releases/download/v0.10.4/buildx-v0.10.4.linux-ppc64le.provenance.json",
"https://github.com/docker/buildx/releases/download/v0.10.4/buildx-v0.10.4.linux-ppc64le.sbom.json",
"https://github.com/docker/buildx/releases/download/v0.10.4/buildx-v0.10.4.linux-riscv64",
"https://github.com/docker/buildx/releases/download/v0.10.4/buildx-v0.10.4.linux-riscv64.provenance.json",
"https://github.com/docker/buildx/releases/download/v0.10.4/buildx-v0.10.4.linux-riscv64.sbom.json",
"https://github.com/docker/buildx/releases/download/v0.10.4/buildx-v0.10.4.linux-s390x",
"https://github.com/docker/buildx/releases/download/v0.10.4/buildx-v0.10.4.linux-s390x.provenance.json",
"https://github.com/docker/buildx/releases/download/v0.10.4/buildx-v0.10.4.linux-s390x.sbom.json",
"https://github.com/docker/buildx/releases/download/v0.10.4/buildx-v0.10.4.windows-amd64.exe",
"https://github.com/docker/buildx/releases/download/v0.10.4/buildx-v0.10.4.windows-amd64.provenance.json",
"https://github.com/docker/buildx/releases/download/v0.10.4/buildx-v0.10.4.windows-amd64.sbom.json",
"https://github.com/docker/buildx/releases/download/v0.10.4/buildx-v0.10.4.windows-arm64.exe",
"https://github.com/docker/buildx/releases/download/v0.10.4/buildx-v0.10.4.windows-arm64.provenance.json",
"https://github.com/docker/buildx/releases/download/v0.10.4/buildx-v0.10.4.windows-arm64.sbom.json",
"https://github.com/docker/buildx/releases/download/v0.10.4/checksums.txt"
]
},
"v0.10.4": {
"id": 94659464,
"tag_name": "v0.10.4",
"html_url": "https://github.com/docker/buildx/releases/tag/v0.10.4",
"assets": [
"https://github.com/docker/buildx/releases/download/v0.10.4/buildx-v0.10.4.darwin-amd64",
"https://github.com/docker/buildx/releases/download/v0.10.4/buildx-v0.10.4.darwin-amd64.provenance.json",
"https://github.com/docker/buildx/releases/download/v0.10.4/buildx-v0.10.4.darwin-amd64.sbom.json",
"https://github.com/docker/buildx/releases/download/v0.10.4/buildx-v0.10.4.darwin-arm64",
"https://github.com/docker/buildx/releases/download/v0.10.4/buildx-v0.10.4.darwin-arm64.provenance.json",
"https://github.com/docker/buildx/releases/download/v0.10.4/buildx-v0.10.4.darwin-arm64.sbom.json",
"https://github.com/docker/buildx/releases/download/v0.10.4/buildx-v0.10.4.linux-amd64",
"https://github.com/docker/buildx/releases/download/v0.10.4/buildx-v0.10.4.linux-amd64.provenance.json",
"https://github.com/docker/buildx/releases/download/v0.10.4/buildx-v0.10.4.linux-amd64.sbom.json",
"https://github.com/docker/buildx/releases/download/v0.10.4/buildx-v0.10.4.linux-arm-v6",
"https://github.com/docker/buildx/releases/download/v0.10.4/buildx-v0.10.4.linux-arm-v6.provenance.json",
"https://github.com/docker/buildx/releases/download/v0.10.4/buildx-v0.10.4.linux-arm-v6.sbom.json",
"https://github.com/docker/buildx/releases/download/v0.10.4/buildx-v0.10.4.linux-arm-v7",
"https://github.com/docker/buildx/releases/download/v0.10.4/buildx-v0.10.4.linux-arm-v7.provenance.json",
"https://github.com/docker/buildx/releases/download/v0.10.4/buildx-v0.10.4.linux-arm-v7.sbom.json",
"https://github.com/docker/buildx/releases/download/v0.10.4/buildx-v0.10.4.linux-arm64",
"https://github.com/docker/buildx/releases/download/v0.10.4/buildx-v0.10.4.linux-arm64.provenance.json",
"https://github.com/docker/buildx/releases/download/v0.10.4/buildx-v0.10.4.linux-arm64.sbom.json",
"https://github.com/docker/buildx/releases/download/v0.10.4/buildx-v0.10.4.linux-ppc64le",
"https://github.com/docker/buildx/releases/download/v0.10.4/buildx-v0.10.4.linux-ppc64le.provenance.json",
"https://github.com/docker/buildx/releases/download/v0.10.4/buildx-v0.10.4.linux-ppc64le.sbom.json",
"https://github.com/docker/buildx/releases/download/v0.10.4/buildx-v0.10.4.linux-riscv64",
"https://github.com/docker/buildx/releases/download/v0.10.4/buildx-v0.10.4.linux-riscv64.provenance.json",
"https://github.com/docker/buildx/releases/download/v0.10.4/buildx-v0.10.4.linux-riscv64.sbom.json",
"https://github.com/docker/buildx/releases/download/v0.10.4/buildx-v0.10.4.linux-s390x",
"https://github.com/docker/buildx/releases/download/v0.10.4/buildx-v0.10.4.linux-s390x.provenance.json",
"https://github.com/docker/buildx/releases/download/v0.10.4/buildx-v0.10.4.linux-s390x.sbom.json",
"https://github.com/docker/buildx/releases/download/v0.10.4/buildx-v0.10.4.windows-amd64.exe",
"https://github.com/docker/buildx/releases/download/v0.10.4/buildx-v0.10.4.windows-amd64.provenance.json",
"https://github.com/docker/buildx/releases/download/v0.10.4/buildx-v0.10.4.windows-amd64.sbom.json",
"https://github.com/docker/buildx/releases/download/v0.10.4/buildx-v0.10.4.windows-arm64.exe",
"https://github.com/docker/buildx/releases/download/v0.10.4/buildx-v0.10.4.windows-arm64.provenance.json",
"https://github.com/docker/buildx/releases/download/v0.10.4/buildx-v0.10.4.windows-arm64.sbom.json",
"https://github.com/docker/buildx/releases/download/v0.10.4/checksums.txt"
]
},
"v0.10.3": {

728
.github/docker-releases.json vendored Normal file
View File

@@ -0,0 +1,728 @@
{
"latest": {
"id": 91964526,
"tag_name": "v23.0.1",
"html_url": "https://github.com/moby/moby/releases/tag/v23.0.1",
"assets": []
},
"v23.0.1": {
"id": 91964526,
"tag_name": "v23.0.1",
"html_url": "https://github.com/moby/moby/releases/tag/v23.0.1",
"assets": []
},
"v23.0.0": {
"id": 91109643,
"tag_name": "v23.0.0",
"html_url": "https://github.com/moby/moby/releases/tag/v23.0.0",
"assets": []
},
"v23.0.0-rc.4": {
"id": 91003797,
"tag_name": "v23.0.0-rc.4",
"html_url": "https://github.com/moby/moby/releases/tag/v23.0.0-rc.4",
"assets": []
},
"v23.0.0-rc.3": {
"id": 89780703,
"tag_name": "v23.0.0-rc.3",
"html_url": "https://github.com/moby/moby/releases/tag/v23.0.0-rc.3",
"assets": []
},
"v20.10.23": {
"id": 89647366,
"tag_name": "v20.10.23",
"html_url": "https://github.com/moby/moby/releases/tag/v20.10.23",
"assets": []
},
"v23.0.0-rc.2": {
"id": 88712255,
"tag_name": "v23.0.0-rc.2",
"html_url": "https://github.com/moby/moby/releases/tag/v23.0.0-rc.2",
"assets": []
},
"v23.0.0-rc.1": {
"id": 87299039,
"tag_name": "v23.0.0-rc.1",
"html_url": "https://github.com/moby/moby/releases/tag/v23.0.0-rc.1",
"assets": []
},
"v20.10.22": {
"id": 86325342,
"tag_name": "v20.10.22",
"html_url": "https://github.com/moby/moby/releases/tag/v20.10.22",
"assets": []
},
"v23.0.0-beta.1": {
"id": 85159482,
"tag_name": "v23.0.0-beta.1",
"html_url": "https://github.com/moby/moby/releases/tag/v23.0.0-beta.1",
"assets": []
},
"v20.10.21": {
"id": 80977884,
"tag_name": "v20.10.21",
"html_url": "https://github.com/moby/moby/releases/tag/v20.10.21",
"assets": []
},
"v20.10.20": {
"id": 80248420,
"tag_name": "v20.10.20",
"html_url": "https://github.com/moby/moby/releases/tag/v20.10.20",
"assets": []
},
"v20.10.19": {
"id": 79847378,
"tag_name": "v20.10.19",
"html_url": "https://github.com/moby/moby/releases/tag/v20.10.19",
"assets": []
},
"v20.10.18": {
"id": 76694729,
"tag_name": "v20.10.18",
"html_url": "https://github.com/moby/moby/releases/tag/v20.10.18",
"assets": []
},
"v20.10.17": {
"id": 68777665,
"tag_name": "v20.10.17",
"html_url": "https://github.com/moby/moby/releases/tag/v20.10.17",
"assets": []
},
"v22.06.0-beta.0": {
"id": 68600276,
"tag_name": "v22.06.0-beta.0",
"html_url": "https://github.com/moby/moby/releases/tag/v22.06.0-beta.0",
"assets": []
},
"v20.10.16": {
"id": 66708640,
"tag_name": "v20.10.16",
"html_url": "https://github.com/moby/moby/releases/tag/v20.10.16",
"assets": []
},
"v20.10.15": {
"id": 66170410,
"tag_name": "v20.10.15",
"html_url": "https://github.com/moby/moby/releases/tag/v20.10.15",
"assets": []
},
"v20.10.14": {
"id": 62642891,
"tag_name": "v20.10.14",
"html_url": "https://github.com/moby/moby/releases/tag/v20.10.14",
"assets": []
},
"v20.10.13": {
"id": 61523032,
"tag_name": "v20.10.13",
"html_url": "https://github.com/moby/moby/releases/tag/v20.10.13",
"assets": []
},
"v20.10.12": {
"id": 56724849,
"tag_name": "v20.10.12",
"html_url": "https://github.com/moby/moby/releases/tag/v20.10.12",
"assets": []
},
"v20.10.11": {
"id": 53604359,
"tag_name": "v20.10.11",
"html_url": "https://github.com/moby/moby/releases/tag/v20.10.11",
"assets": []
},
"v20.10.10": {
"id": 51991530,
"tag_name": "v20.10.10",
"html_url": "https://github.com/moby/moby/releases/tag/v20.10.10",
"assets": []
},
"v20.10.9": {
"id": 50763745,
"tag_name": "v20.10.9",
"html_url": "https://github.com/moby/moby/releases/tag/v20.10.9",
"assets": []
},
"v20.10.8": {
"id": 47261111,
"tag_name": "v20.10.8",
"html_url": "https://github.com/moby/moby/releases/tag/v20.10.8",
"assets": []
},
"v20.10.7": {
"id": 44002175,
"tag_name": "v20.10.7",
"html_url": "https://github.com/moby/moby/releases/tag/v20.10.7",
"assets": []
},
"v20.10.6": {
"id": 41439201,
"tag_name": "v20.10.6",
"html_url": "https://github.com/moby/moby/releases/tag/v20.10.6",
"assets": []
},
"v20.10.5": {
"id": 39216180,
"tag_name": "v20.10.5",
"html_url": "https://github.com/moby/moby/releases/tag/v20.10.5",
"assets": []
},
"v20.10.4": {
"id": 39014860,
"tag_name": "v20.10.4",
"html_url": "https://github.com/moby/moby/releases/tag/v20.10.4",
"assets": []
},
"v20.10.3": {
"id": 37231470,
"tag_name": "v20.10.3",
"html_url": "https://github.com/moby/moby/releases/tag/v20.10.3",
"assets": []
},
"v19.03.15": {
"id": 37231443,
"tag_name": "v19.03.15",
"html_url": "https://github.com/moby/moby/releases/tag/v19.03.15",
"assets": []
},
"v20.10.2": {
"id": 35990169,
"tag_name": "v20.10.2",
"html_url": "https://github.com/moby/moby/releases/tag/v20.10.2",
"assets": []
},
"v20.10.1": {
"id": 35281927,
"tag_name": "v20.10.1",
"html_url": "https://github.com/moby/moby/releases/tag/v20.10.1",
"assets": []
},
"v20.10.0": {
"id": 35069369,
"tag_name": "v20.10.0",
"html_url": "https://github.com/moby/moby/releases/tag/v20.10.0",
"assets": []
},
"v19.03.14": {
"id": 34677482,
"tag_name": "v19.03.14",
"html_url": "https://github.com/moby/moby/releases/tag/v19.03.14",
"assets": []
},
"v19.03.13": {
"id": 31493434,
"tag_name": "v19.03.13",
"html_url": "https://github.com/moby/moby/releases/tag/v19.03.13",
"assets": []
},
"v19.03.12": {
"id": 28065393,
"tag_name": "v19.03.12",
"html_url": "https://github.com/moby/moby/releases/tag/v19.03.12",
"assets": []
},
"v19.03.11": {
"id": 27237950,
"tag_name": "v19.03.11",
"html_url": "https://github.com/moby/moby/releases/tag/v19.03.11",
"assets": []
},
"v19.03.10": {
"id": 27043306,
"tag_name": "v19.03.10",
"html_url": "https://github.com/moby/moby/releases/tag/v19.03.10",
"assets": []
},
"v19.03.9": {
"id": 27002855,
"tag_name": "v19.03.9",
"html_url": "https://github.com/moby/moby/releases/tag/v19.03.9",
"assets": []
},
"v19.03.8": {
"id": 25372883,
"tag_name": "v19.03.8",
"html_url": "https://github.com/moby/moby/releases/tag/v19.03.8",
"assets": []
},
"v17.03.2-ce": {
"id": 6858533,
"tag_name": "v17.03.2-ce",
"html_url": "https://github.com/moby/moby/releases/tag/v17.03.2-ce",
"assets": []
},
"v17.03.2-ce-rc1": {
"id": 6547028,
"tag_name": "v17.03.2-ce-rc1",
"html_url": "https://github.com/moby/moby/releases/tag/v17.03.2-ce-rc1",
"assets": []
},
"v17.05.0-ce": {
"id": 6295254,
"tag_name": "v17.05.0-ce",
"html_url": "https://github.com/moby/moby/releases/tag/v17.05.0-ce",
"assets": []
},
"v17.05.0-ce-rc3": {
"id": 6259851,
"tag_name": "v17.05.0-ce-rc3",
"html_url": "https://github.com/moby/moby/releases/tag/v17.05.0-ce-rc3",
"assets": []
},
"v17.05.0-ce-rc2": {
"id": 6216216,
"tag_name": "v17.05.0-ce-rc2",
"html_url": "https://github.com/moby/moby/releases/tag/v17.05.0-ce-rc2",
"assets": []
},
"v17.05.0-ce-rc1": {
"id": 6066291,
"tag_name": "v17.05.0-ce-rc1",
"html_url": "https://github.com/moby/moby/releases/tag/v17.05.0-ce-rc1",
"assets": []
},
"v17.04.0-ce": {
"id": 5992837,
"tag_name": "v17.04.0-ce",
"html_url": "https://github.com/moby/moby/releases/tag/v17.04.0-ce",
"assets": []
},
"v17.04.0-ce-rc2": {
"id": 5930499,
"tag_name": "v17.04.0-ce-rc2",
"html_url": "https://github.com/moby/moby/releases/tag/v17.04.0-ce-rc2",
"assets": []
},
"v17.03.1-ce": {
"id": 5889333,
"tag_name": "v17.03.1-ce",
"html_url": "https://github.com/moby/moby/releases/tag/v17.03.1-ce",
"assets": []
},
"v17.04.0-ce-rc1": {
"id": 5821903,
"tag_name": "v17.04.0-ce-rc1",
"html_url": "https://github.com/moby/moby/releases/tag/v17.04.0-ce-rc1",
"assets": []
},
"v17.03.1-ce-rc1": {
"id": 5787909,
"tag_name": "v17.03.1-ce-rc1",
"html_url": "https://github.com/moby/moby/releases/tag/v17.03.1-ce-rc1",
"assets": []
},
"v17.03.0-ce": {
"id": 5616072,
"tag_name": "v17.03.0-ce",
"html_url": "https://github.com/moby/moby/releases/tag/v17.03.0-ce",
"assets": []
},
"v17.03.0-ce-rc1": {
"id": 5516127,
"tag_name": "v17.03.0-ce-rc1",
"html_url": "https://github.com/moby/moby/releases/tag/v17.03.0-ce-rc1",
"assets": []
},
"v1.13.1": {
"id": 5400129,
"tag_name": "v1.13.1",
"html_url": "https://github.com/moby/moby/releases/tag/v1.13.1",
"assets": []
},
"v1.13.1-rc2": {
"id": 5385634,
"tag_name": "v1.13.1-rc2",
"html_url": "https://github.com/moby/moby/releases/tag/v1.13.1-rc2",
"assets": []
},
"v1.13.1-rc1": {
"id": 5307652,
"tag_name": "v1.13.1-rc1",
"html_url": "https://github.com/moby/moby/releases/tag/v1.13.1-rc1",
"assets": []
},
"v1.13.0": {
"id": 5196571,
"tag_name": "v1.13.0",
"html_url": "https://github.com/moby/moby/releases/tag/v1.13.0",
"assets": []
},
"v1.13.0-rc7": {
"id": 5157693,
"tag_name": "v1.13.0-rc7",
"html_url": "https://github.com/moby/moby/releases/tag/v1.13.0-rc7",
"assets": []
},
"v1.13.0-rc6": {
"id": 5135134,
"tag_name": "v1.13.0-rc6",
"html_url": "https://github.com/moby/moby/releases/tag/v1.13.0-rc6",
"assets": []
},
"v1.12.6": {
"id": 5123890,
"tag_name": "v1.12.6",
"html_url": "https://github.com/moby/moby/releases/tag/v1.12.6",
"assets": []
},
"v1.13.0-rc5": {
"id": 5080578,
"tag_name": "v1.13.0-rc5",
"html_url": "https://github.com/moby/moby/releases/tag/v1.13.0-rc5",
"assets": []
},
"v1.13.0-rc4": {
"id": 4948866,
"tag_name": "v1.13.0-rc4",
"html_url": "https://github.com/moby/moby/releases/tag/v1.13.0-rc4",
"assets": []
},
"v1.12.5": {
"id": 4938198,
"tag_name": "v1.12.5",
"html_url": "https://github.com/moby/moby/releases/tag/v1.12.5",
"assets": []
},
"v1.12.5-rc1": {
"id": 4926422,
"tag_name": "v1.12.5-rc1",
"html_url": "https://github.com/moby/moby/releases/tag/v1.12.5-rc1",
"assets": []
},
"v1.12.4": {
"id": 4901878,
"tag_name": "v1.12.4",
"html_url": "https://github.com/moby/moby/releases/tag/v1.12.4",
"assets": []
},
"v1.12.4-rc1": {
"id": 4863914,
"tag_name": "v1.12.4-rc1",
"html_url": "https://github.com/moby/moby/releases/tag/v1.12.4-rc1",
"assets": []
},
"v1.13.0-rc3": {
"id": 4840704,
"tag_name": "v1.13.0-rc3",
"html_url": "https://github.com/moby/moby/releases/tag/v1.13.0-rc3",
"assets": []
},
"v1.13.0-rc2": {
"id": 4744761,
"tag_name": "v1.13.0-rc2",
"html_url": "https://github.com/moby/moby/releases/tag/v1.13.0-rc2",
"assets": []
},
"v1.13.0-rc1": {
"id": 4641203,
"tag_name": "v1.13.0-rc1",
"html_url": "https://github.com/moby/moby/releases/tag/v1.13.0-rc1",
"assets": []
},
"v1.12.3": {
"id": 4495222,
"tag_name": "v1.12.3",
"html_url": "https://github.com/moby/moby/releases/tag/v1.12.3",
"assets": []
},
"v1.12.3-rc1": {
"id": 4481016,
"tag_name": "v1.12.3-rc1",
"html_url": "https://github.com/moby/moby/releases/tag/v1.12.3-rc1",
"assets": []
},
"v1.12.2": {
"id": 4364345,
"tag_name": "v1.12.2",
"html_url": "https://github.com/moby/moby/releases/tag/v1.12.2",
"assets": []
},
"v1.12.2-rc3": {
"id": 4336430,
"tag_name": "v1.12.2-rc3",
"html_url": "https://github.com/moby/moby/releases/tag/v1.12.2-rc3",
"assets": []
},
"v1.12.2-rc2": {
"id": 4304701,
"tag_name": "v1.12.2-rc2",
"html_url": "https://github.com/moby/moby/releases/tag/v1.12.2-rc2",
"assets": []
},
"v1.12.2-rc1": {
"id": 4246481,
"tag_name": "v1.12.2-rc1",
"html_url": "https://github.com/moby/moby/releases/tag/v1.12.2-rc1",
"assets": []
},
"v1.12.1": {
"id": 3919520,
"tag_name": "v1.12.1",
"html_url": "https://github.com/moby/moby/releases/tag/v1.12.1",
"assets": []
},
"v1.12.1-rc2": {
"id": 3909470,
"tag_name": "v1.12.1-rc2",
"html_url": "https://github.com/moby/moby/releases/tag/v1.12.1-rc2",
"assets": []
},
"v1.12.1-rc1": {
"id": 3879305,
"tag_name": "v1.12.1-rc1",
"html_url": "https://github.com/moby/moby/releases/tag/v1.12.1-rc1",
"assets": []
},
"v1.12.0": {
"id": 3766135,
"tag_name": "v1.12.0",
"html_url": "https://github.com/moby/moby/releases/tag/v1.12.0",
"assets": []
},
"v1.12.0-rc5": {
"id": 3744904,
"tag_name": "v1.12.0-rc5",
"html_url": "https://github.com/moby/moby/releases/tag/v1.12.0-rc5",
"assets": []
},
"v1.12.0-rc4": {
"id": 3644623,
"tag_name": "v1.12.0-rc4",
"html_url": "https://github.com/moby/moby/releases/tag/v1.12.0-rc4",
"assets": []
},
"v1.12.0-rc3": {
"id": 3573896,
"tag_name": "v1.12.0-rc3",
"html_url": "https://github.com/moby/moby/releases/tag/v1.12.0-rc3",
"assets": []
},
"v1.12.0-rc2": {
"id": 3471944,
"tag_name": "v1.12.0-rc2",
"html_url": "https://github.com/moby/moby/releases/tag/v1.12.0-rc2",
"assets": []
},
"v1.12.0-rc1": {
"id": 3447699,
"tag_name": "v1.12.0-rc1",
"html_url": "https://github.com/moby/moby/releases/tag/v1.12.0-rc1",
"assets": []
},
"v1.11.2": {
"id": 3354503,
"tag_name": "v1.11.2",
"html_url": "https://github.com/moby/moby/releases/tag/v1.11.2",
"assets": []
},
"v1.11.2-rc1": {
"id": 3327300,
"tag_name": "v1.11.2-rc1",
"html_url": "https://github.com/moby/moby/releases/tag/v1.11.2-rc1",
"assets": []
},
"v1.11.1": {
"id": 3105125,
"tag_name": "v1.11.1",
"html_url": "https://github.com/moby/moby/releases/tag/v1.11.1",
"assets": []
},
"v1.11.1-rc1": {
"id": 3097597,
"tag_name": "v1.11.1-rc1",
"html_url": "https://github.com/moby/moby/releases/tag/v1.11.1-rc1",
"assets": []
},
"v1.11.0": {
"id": 3014278,
"tag_name": "v1.11.0",
"html_url": "https://github.com/moby/moby/releases/tag/v1.11.0",
"assets": []
},
"v1.11.0-rc5": {
"id": 2998258,
"tag_name": "v1.11.0-rc5",
"html_url": "https://github.com/moby/moby/releases/tag/v1.11.0-rc5",
"assets": []
},
"v1.11.0-rc4": {
"id": 2968912,
"tag_name": "v1.11.0-rc4",
"html_url": "https://github.com/moby/moby/releases/tag/v1.11.0-rc4",
"assets": []
},
"v1.11.0-rc3": {
"id": 2937939,
"tag_name": "v1.11.0-rc3",
"html_url": "https://github.com/moby/moby/releases/tag/v1.11.0-rc3",
"assets": []
},
"v1.11.0-rc2": {
"id": 2890861,
"tag_name": "v1.11.0-rc2",
"html_url": "https://github.com/moby/moby/releases/tag/v1.11.0-rc2",
"assets": []
},
"v1.11.0-rc1": {
"id": 2875983,
"tag_name": "v1.11.0-rc1",
"html_url": "https://github.com/moby/moby/releases/tag/v1.11.0-rc1",
"assets": []
},
"v1.10.3": {
"id": 2788494,
"tag_name": "v1.10.3",
"html_url": "https://github.com/moby/moby/releases/tag/v1.10.3",
"assets": []
},
"v1.10.3-rc2": {
"id": 2780060,
"tag_name": "v1.10.3-rc2",
"html_url": "https://github.com/moby/moby/releases/tag/v1.10.3-rc2",
"assets": []
},
"v1.10.3-rc1": {
"id": 2777835,
"tag_name": "v1.10.3-rc1",
"html_url": "https://github.com/moby/moby/releases/tag/v1.10.3-rc1",
"assets": []
},
"v1.10.2": {
"id": 2666504,
"tag_name": "v1.10.2",
"html_url": "https://github.com/moby/moby/releases/tag/v1.10.2",
"assets": []
},
"v1.10.2-rc1": {
"id": 2652399,
"tag_name": "v1.10.2-rc1",
"html_url": "https://github.com/moby/moby/releases/tag/v1.10.2-rc1",
"assets": []
},
"v1.10.1": {
"id": 2598018,
"tag_name": "v1.10.1",
"html_url": "https://github.com/moby/moby/releases/tag/v1.10.1",
"assets": []
},
"v1.10.1-rc1": {
"id": 2590708,
"tag_name": "v1.10.1-rc1",
"html_url": "https://github.com/moby/moby/releases/tag/v1.10.1-rc1",
"assets": []
},
"v1.10.0": {
"id": 2555659,
"tag_name": "v1.10.0",
"html_url": "https://github.com/moby/moby/releases/tag/v1.10.0",
"assets": []
},
"v1.10.0-rc4": {
"id": 2549294,
"tag_name": "v1.10.0-rc4",
"html_url": "https://github.com/moby/moby/releases/tag/v1.10.0-rc4",
"assets": []
},
"v1.10.0-rc3": {
"id": 2541607,
"tag_name": "v1.10.0-rc3",
"html_url": "https://github.com/moby/moby/releases/tag/v1.10.0-rc3",
"assets": []
},
"v1.10.0-rc2": {
"id": 2505382,
"tag_name": "v1.10.0-rc2",
"html_url": "https://github.com/moby/moby/releases/tag/v1.10.0-rc2",
"assets": []
},
"v1.10.0-rc1": {
"id": 2437435,
"tag_name": "v1.10.0-rc1",
"html_url": "https://github.com/moby/moby/releases/tag/v1.10.0-rc1",
"assets": []
},
"v1.9.1": {
"id": 2161885,
"tag_name": "v1.9.1",
"html_url": "https://github.com/moby/moby/releases/tag/v1.9.1",
"assets": []
},
"v1.9.1-rc1": {
"id": 2124307,
"tag_name": "v1.9.1-rc1",
"html_url": "https://github.com/moby/moby/releases/tag/v1.9.1-rc1",
"assets": []
},
"v1.9.0": {
"id": 2065556,
"tag_name": "v1.9.0",
"html_url": "https://github.com/moby/moby/releases/tag/v1.9.0",
"assets": []
},
"v1.9.0-rc5": {
"id": 2063038,
"tag_name": "v1.9.0-rc5",
"html_url": "https://github.com/moby/moby/releases/tag/v1.9.0-rc5",
"assets": []
},
"v1.9.0-rc4": {
"id": 2051407,
"tag_name": "v1.9.0-rc4",
"html_url": "https://github.com/moby/moby/releases/tag/v1.9.0-rc4",
"assets": []
},
"v1.9.0-rc3": {
"id": 2030176,
"tag_name": "v1.9.0-rc3",
"html_url": "https://github.com/moby/moby/releases/tag/v1.9.0-rc3",
"assets": []
},
"v1.9.0-rc2": {
"id": 2006252,
"tag_name": "v1.9.0-rc2",
"html_url": "https://github.com/moby/moby/releases/tag/v1.9.0-rc2",
"assets": []
},
"v1.9.0-rc1": {
"id": 1960642,
"tag_name": "v1.9.0-rc1",
"html_url": "https://github.com/moby/moby/releases/tag/v1.9.0-rc1",
"assets": []
},
"v1.8.3": {
"id": 1948004,
"tag_name": "v1.8.3",
"html_url": "https://github.com/moby/moby/releases/tag/v1.8.3",
"assets": []
},
"v1.8.2": {
"id": 1796575,
"tag_name": "v1.8.2",
"html_url": "https://github.com/moby/moby/releases/tag/v1.8.2",
"assets": []
},
"v1.8.2-rc1": {
"id": 1765231,
"tag_name": "v1.8.2-rc1",
"html_url": "https://github.com/moby/moby/releases/tag/v1.8.2-rc1",
"assets": []
},
"v1.8.1": {
"id": 1665370,
"tag_name": "v1.8.1",
"html_url": "https://github.com/moby/moby/releases/tag/v1.8.1",
"assets": []
},
"v1.8.0": {
"id": 1657439,
"tag_name": "v1.8.0",
"html_url": "https://github.com/moby/moby/releases/tag/v1.8.0",
"assets": []
},
"v1.8.0-rc3": {
"id": 1643499,
"tag_name": "v1.8.0-rc3",
"html_url": "https://github.com/moby/moby/releases/tag/v1.8.0-rc3",
"assets": []
}
}

View File

@@ -6,7 +6,7 @@ on:
- 'main'
pull_request:
paths-ignore:
- '.github/buildx-releases.json'
- '.github/*-releases.json'
jobs:
build:

View File

@@ -13,7 +13,7 @@ on:
- 'main'
pull_request:
paths-ignore:
- '.github/buildx-releases.json'
- '.github/*-releases.json'
jobs:
generate:

View File

@@ -0,0 +1,58 @@
name: docker-releases-json
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
workflow_dispatch:
schedule:
- cron: '0 */12 * * *'
push:
branches:
- 'main'
pull_request:
paths-ignore:
- '.github/*-releases.json'
jobs:
generate:
uses: crazy-max/.github/.github/workflows/releases-json.yml@2a596c917a8ad3e6203ae99b777148525a2e00d5
with:
repository: moby/moby
artifact_name: docker-releases-json
filename: docker-releases.json
secrets: inherit
open-pr:
runs-on: ubuntu-22.04
if: github.event_name != 'pull_request'
needs:
- generate
steps:
-
name: Checkout
uses: actions/checkout@v3
-
name: Download
uses: actions/download-artifact@v3
with:
name: docker-releases-json
path: .github
-
name: Commit changes
run: |
git add -A .
-
name: Create PR
uses: peter-evans/create-pull-request@2b011faafdcbc9ceb11414d64d0573f37c774b04
with:
base: main
branch: bot/docker-releases-json
commit-message: "github: update .github/docker-releases.json"
signoff: true
delete-branch: true
title: "Update `.github/docker-releases.json`"
body: |
Update `.github/docker-releases.json` to keep in sync with [https://github.com/moby/moby](https://github.com/moby/moby).
draft: false

View File

@@ -7,7 +7,7 @@ on:
- 'main'
pull_request:
paths-ignore:
- '.github/buildx-releases.json'
- '.github/*-releases.json'
jobs:
test:

View File

@@ -6,7 +6,7 @@ on:
- 'main'
pull_request:
paths-ignore:
- '.github/buildx-releases.json'
- '.github/*-releases.json'
jobs:
validate:

View File

@@ -19,6 +19,7 @@ import * as fs from 'fs';
import * as path from 'path';
import {Builder} from '../../src/buildx/builder';
import {Exec} from '../../src/exec';
import {BuilderInfo} from '../../src/types/builder';
@@ -47,6 +48,19 @@ jest.spyOn(Builder.prototype, 'inspect').mockImplementation(async (): Promise<Bu
};
});
describe('exists', () => {
it('valid', async () => {
const execSpy = jest.spyOn(Exec, 'getExecOutput');
const builder = new Builder();
await builder.exists('foo');
// eslint-disable-next-line jest/no-standalone-expect
expect(execSpy).toHaveBeenCalledWith(`docker`, ['buildx', 'inspect', 'foo'], {
silent: true,
ignoreReturnCode: true
});
});
});
describe('inspect', () => {
it('valid', async () => {
const builder = new Builder();

View File

@@ -21,19 +21,23 @@ import {Install} from '../../src/docker/install';
import {Docker} from '../../src/docker/docker';
// prettier-ignore
const tmpDir = path.join(process.env.TEMP || '/tmp', 'buildx-jest');
const tmpDir = path.join(process.env.TEMP || '/tmp', 'docker-install-jest');
describe('install', () => {
// prettier-ignore
test.each(['23.0.0'])(
test.each(['v23.0.0'])(
'install docker %s', async (version) => {
await expect((async () => {
const install = new Install();
const toolPath = await install.download(version);
await install.install(toolPath, tmpDir, version);
const install = new Install({
version: version,
runDir: tmpDir,
contextName: 'foo'
});
await install.download();
await install.install();
await Docker.printVersion();
await Docker.printInfo();
await install.tearDown(tmpDir);
await install.tearDown();
})()).resolves.not.toThrow();
});
});

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
import {describe, expect, jest, test, beforeEach, afterEach} from '@jest/globals';
import {describe, expect, jest, test, beforeEach, afterEach, it} from '@jest/globals';
import * as fs from 'fs';
import * as path from 'path';
import * as rimraf from 'rimraf';
@@ -23,7 +23,7 @@ import osm = require('os');
import {Install} from '../../src/docker/install';
// prettier-ignore
const tmpDir = path.join(process.env.TEMP || '/tmp', 'buildx-jest');
const tmpDir = path.join(process.env.TEMP || '/tmp', 'docker-install-jest');
beforeEach(() => {
jest.clearAllMocks();
@@ -36,15 +36,38 @@ afterEach(function () {
describe('download', () => {
// prettier-ignore
test.each([
['19.03.6', 'linux'],
['20.10.22', 'linux'],
['20.10.22', 'darwin'],
['20.10.22', 'win32'],
['v19.03.14', 'linux'],
['v20.10.22', 'linux'],
['v20.10.22', 'darwin'],
['v20.10.22', 'win32'],
])(
'acquires %p of docker (%s)', async (version, platformOS) => {
jest.spyOn(osm, 'platform').mockImplementation(() => platformOS);
const install = new Install();
const toolPath = await install.download(version);
const install = new Install({
version: version,
runDir: tmpDir,
});
const toolPath = await install.download();
expect(fs.existsSync(toolPath)).toBe(true);
}, 100000);
});
describe('getRelease', () => {
it('returns latest docker GitHub release', async () => {
const release = await Install.getRelease('latest');
expect(release).not.toBeNull();
expect(release?.tag_name).not.toEqual('');
});
it('returns v23.0.0 buildx GitHub release', async () => {
const release = await Install.getRelease('v23.0.0');
expect(release).not.toBeNull();
expect(release?.id).toEqual(91109643);
expect(release?.tag_name).toEqual('v23.0.0');
expect(release?.html_url).toEqual('https://github.com/moby/moby/releases/tag/v23.0.0');
});
it('unknown release', async () => {
await expect(Install.getRelease('foo')).rejects.toThrowError(new Error('Cannot find Docker release foo in https://raw.githubusercontent.com/docker/actions-toolkit/main/.github/docker-releases.json'));
});
});

View File

@@ -14,6 +14,8 @@
* limitations under the License.
*/
import * as core from '@actions/core';
import {Buildx} from './buildx';
import {Exec} from '../exec';
@@ -30,6 +32,29 @@ export class Builder {
this.buildx = opts?.buildx || new Buildx();
}
public async exists(name: string): Promise<boolean> {
const cmd = await this.buildx.getCommand(['inspect', name]);
const ok: boolean = await Exec.getExecOutput(cmd.command, cmd.args, {
ignoreReturnCode: true,
silent: true
})
.then(res => {
if (res.stderr.length > 0 && res.exitCode != 0) {
core.debug(`Builder.exists cmd err: ${res.stderr.trim()}`);
return false;
}
return res.exitCode == 0;
})
.catch(error => {
core.debug(`Builder.exists error: ${error}`);
return false;
});
core.debug(`Builder.exists: ${ok}`);
return ok;
}
public async inspect(name: string): Promise<BuilderInfo> {
const cmd = await this.buildx.getCommand(['inspect', name]);
return await Exec.getExecOutput(cmd.command, cmd.args, {

View File

@@ -76,7 +76,7 @@ export class Buildx {
})
.then(res => {
if (res.stderr.length > 0 && res.exitCode != 0) {
core.debug(`Buildx.isAvailable cmd err: ${res.stderr}`);
core.debug(`Buildx.isAvailable cmd err: ${res.stderr.trim()}`);
return false;
}
return res.exitCode == 0;

View File

@@ -22,19 +22,50 @@ import retry from 'async-retry';
import * as handlebars from 'handlebars';
import * as util from 'util';
import * as core from '@actions/core';
import * as httpm from '@actions/http-client';
import * as io from '@actions/io';
import * as tc from '@actions/tool-cache';
import {Context} from '../context';
import {Exec} from '../exec';
import {Util} from '../util';
import {colimaYamlData, dockerServiceLogsPs1, setupDockerLinuxSh, setupDockerWinPs1} from './assets';
import {GitHubRelease} from '../types/github';
export interface InstallOpts {
version?: string;
channel?: string;
runDir: string;
contextName?: string;
}
export class Install {
public async download(version: string, channel?: string): Promise<string> {
channel = channel || 'stable';
const downloadURL = this.downloadURL(version, channel);
private readonly runDir: string;
private readonly version: string;
private readonly channel: string;
private readonly contextName: string;
private _version: string | undefined;
private _toolDir: string | undefined;
constructor(opts: InstallOpts) {
this.runDir = opts.runDir;
this.version = opts.version || 'latest';
this.channel = opts.channel || 'stable';
this.contextName = opts.contextName || 'setup-docker-action';
}
get toolDir(): string {
return this._toolDir || Context.tmpDir();
}
public async download(): Promise<string> {
const release: GitHubRelease = await Install.getRelease(this.version);
this._version = release.tag_name.replace(/^v+|v+$/g, '');
core.debug(`docker.Install.download version: ${this._version}`);
const downloadURL = this.downloadURL(this._version, this.channel);
core.info(`Downloading ${downloadURL}`);
const downloadPath = await tc.downloadTool(downloadURL);
core.debug(`docker.Install.download downloadPath: ${downloadPath}`);
@@ -60,31 +91,32 @@ export class Install {
});
});
const tooldir = await tc.cacheDir(extractFolder, `docker-${channel}`, version.replace(/(0+)([1-9]+)/, '$2'));
const tooldir = await tc.cacheDir(extractFolder, `docker-${this.channel}`, this._version.replace(/(0+)([1-9]+)/, '$2'));
core.addPath(tooldir);
core.info('Added Docker to PATH');
this._toolDir = tooldir;
return tooldir;
}
public async install(toolDir: string, runDir: string, version: string, channel?: string): Promise<void> {
if (toolDir.length == 0) {
throw new Error('toolDir must be set');
public async install(): Promise<void> {
if (!this.toolDir) {
throw new Error('toolDir must be set. Run download first.');
}
if (runDir.length == 0) {
if (!this.runDir) {
throw new Error('runDir must be set');
}
channel = channel || 'stable';
switch (os.platform()) {
case 'darwin': {
await this.installDarwin(toolDir, version, channel);
await this.installDarwin();
break;
}
case 'linux': {
await this.installLinux(toolDir, runDir);
await this.installLinux();
break;
}
case 'win32': {
await this.installWindows(toolDir, runDir);
await this.installWindows();
break;
}
default: {
@@ -93,7 +125,7 @@ export class Install {
}
}
private async installDarwin(toolDir: string, version: string, channel?: string): Promise<void> {
private async installDarwin(): Promise<void> {
const colimaDir = path.join(os.homedir(), '.colima', 'default'); // TODO: create a custom colima profile to avoid overlap with other actions
await io.mkdirP(colimaDir);
const dockerHost = `unix://${colimaDir}/docker.sock`;
@@ -107,8 +139,8 @@ export class Install {
await core.group('Creating colima config', async () => {
const colimaCfg = handlebars.compile(colimaYamlData)({
hostArch: Install.platformArch(),
dockerVersion: version,
dockerChannel: channel
dockerVersion: this._version,
dockerChannel: this.channel
});
core.info(`Writing colima config to ${path.join(colimaDir, 'colima.yaml')}`);
fs.writeFileSync(path.join(colimaDir, 'colima.yaml'), colimaCfg);
@@ -118,7 +150,7 @@ export class Install {
// colima is already started on the runner so env var added in download
// method is not expanded to the running process.
const envs = Object.assign({}, process.env, {
PATH: `${toolDir}:${process.env.PATH}`
PATH: `${this.toolDir}:${process.env.PATH}`
}) as {
[key: string]: string;
};
@@ -127,14 +159,14 @@ export class Install {
});
await core.group('Create Docker context', async () => {
await Exec.exec('docker', ['context', 'create', 'setup-docker-action', '--docker', `host=${dockerHost}`]);
await Exec.exec('docker', ['context', 'use', 'setup-docker-action']);
await Exec.exec('docker', ['context', 'create', this.contextName, '--docker', `host=${dockerHost}`]);
await Exec.exec('docker', ['context', 'use', this.contextName]);
});
}
private async installLinux(toolDir: string, runDir: string): Promise<void> {
const dockerHost = `unix://${path.join(runDir, 'docker.sock')}`;
await io.mkdirP(runDir);
private async installLinux(): Promise<void> {
const dockerHost = `unix://${path.join(this.runDir, 'docker.sock')}`;
await io.mkdirP(this.runDir);
await core.group('Start Docker daemon', async () => {
const bashPath: string = await io.which('bash', true);
@@ -143,8 +175,8 @@ export class Install {
shell: true,
stdio: ['ignore', process.stdout, process.stderr],
env: Object.assign({}, process.env, {
TOOLDIR: toolDir,
RUNDIR: runDir,
TOOLDIR: this.toolDir,
RUNDIR: this.runDir,
DOCKER_HOST: dockerHost
}) as {
[key: string]: string;
@@ -182,18 +214,18 @@ export class Install {
});
await core.group('Create Docker context', async () => {
await Exec.exec('docker', ['context', 'create', 'setup-docker-action', '--docker', `host=${dockerHost}`]);
await Exec.exec('docker', ['context', 'use', 'setup-docker-action']);
await Exec.exec('docker', ['context', 'create', this.contextName, '--docker', `host=${dockerHost}`]);
await Exec.exec('docker', ['context', 'use', this.contextName]);
});
}
private async installWindows(toolDir: string, runDir: string): Promise<void> {
private async installWindows(): Promise<void> {
const dockerHost = 'npipe:////./pipe/setup_docker_action';
await core.group('Install Docker daemon service', async () => {
const setupCmd = await Util.powershellCommand(setupDockerWinPs1(), {
ToolDir: toolDir,
RunDir: runDir,
ToolDir: this.toolDir,
RunDir: this.runDir,
DockerHost: dockerHost
});
await Exec.exec(setupCmd.command, setupCmd.args);
@@ -202,19 +234,22 @@ export class Install {
});
await core.group('Create Docker context', async () => {
await Exec.exec('docker', ['context', 'create', 'setup-docker-action', '--docker', `host=${dockerHost}`]);
await Exec.exec('docker', ['context', 'use', 'setup-docker-action']);
await Exec.exec('docker', ['context', 'create', this.contextName, '--docker', `host=${dockerHost}`]);
await Exec.exec('docker', ['context', 'use', this.contextName]);
});
}
public async tearDown(runDir: string): Promise<void> {
public async tearDown(): Promise<void> {
if (!this.runDir) {
throw new Error('runDir must be set');
}
switch (os.platform()) {
case 'darwin': {
await this.tearDownDarwin(runDir);
await this.tearDownDarwin();
break;
}
case 'linux': {
await this.tearDownLinux(runDir);
await this.tearDownLinux();
break;
}
case 'win32': {
@@ -227,7 +262,7 @@ export class Install {
}
}
private async tearDownDarwin(runDir: string): Promise<void> {
private async tearDownDarwin(): Promise<void> {
await core.group('Docker daemon logs', async () => {
await Exec.exec('colima', ['exec', '--', 'cat', '/var/log/docker.log']);
});
@@ -235,25 +270,25 @@ export class Install {
await Exec.exec('colima', ['stop', '--very-verbose']);
});
await core.group('Removing Docker context', async () => {
await Exec.exec('docker', ['context', 'rm', '-f', 'setup-docker-action']);
await Exec.exec('docker', ['context', 'rm', '-f', this.contextName]);
});
await core.group(`Cleaning up runDir`, async () => {
await Exec.exec('sudo', ['rm', '-rf', runDir]);
await Exec.exec('sudo', ['rm', '-rf', this.runDir]);
});
}
private async tearDownLinux(runDir: string): Promise<void> {
private async tearDownLinux(): Promise<void> {
await core.group('Docker daemon logs', async () => {
core.info(fs.readFileSync(path.join(runDir, 'dockerd.log'), {encoding: 'utf8'}));
core.info(fs.readFileSync(path.join(this.runDir, 'dockerd.log'), {encoding: 'utf8'}));
});
await core.group('Stopping Docker daemon', async () => {
await Exec.exec('sudo', ['kill', fs.readFileSync(path.join(runDir, 'docker.pid')).toString().trim()]);
await Exec.exec('sudo', ['kill', fs.readFileSync(path.join(this.runDir, 'docker.pid')).toString().trim()]);
});
await core.group('Removing Docker context', async () => {
await Exec.exec('docker', ['context', 'rm', '-f', 'setup-docker-action']);
await Exec.exec('docker', ['context', 'rm', '-f', this.contextName]);
});
await core.group(`Cleaning up runDir`, async () => {
await Exec.exec('sudo', ['rm', '-rf', runDir]);
await Exec.exec('sudo', ['rm', '-rf', this.runDir]);
});
}
@@ -263,7 +298,7 @@ export class Install {
await Exec.exec(logCmd.command, logCmd.args);
});
await core.group('Removing Docker context', async () => {
await Exec.exec('docker', ['context', 'rm', '-f', 'setup-docker-action']);
await Exec.exec('docker', ['context', 'rm', '-f', this.contextName]);
});
}
@@ -332,4 +367,20 @@ export class Install {
return false;
});
}
public static async getRelease(version: string): Promise<GitHubRelease> {
const url = `https://raw.githubusercontent.com/docker/actions-toolkit/main/.github/docker-releases.json`;
const http: httpm.HttpClient = new httpm.HttpClient('docker-actions-toolkit');
const resp: httpm.HttpClientResponse = await http.get(url);
const body = await resp.readBody();
const statusCode = resp.message.statusCode || 500;
if (statusCode >= 400) {
throw new Error(`Failed to get Docker release ${version} from ${url} with status code ${statusCode}: ${body}`);
}
const releases = <Record<string, GitHubRelease>>JSON.parse(body);
if (!releases[version]) {
throw new Error(`Cannot find Docker release ${version} in ${url}`);
}
return releases[version];
}
}