Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
37b0f81ca2 | ||
|
|
2d2bc848fe | ||
|
|
8c97b0d9b4 | ||
|
|
9da4a47d60 | ||
|
|
80e4f3c485 | ||
|
|
cb33662ebc | ||
|
|
1b63de84b1 | ||
|
|
577f9b9555 | ||
|
|
c6389d840e | ||
|
|
d90b053e7c |
41
.github/buildx-lab-releases.json
vendored
41
.github/buildx-lab-releases.json
vendored
@@ -40,6 +40,47 @@
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.17.1-desktop.1/checksums.txt"
|
||||
]
|
||||
},
|
||||
"v0.18.0-desktop.2": {
|
||||
"id": 183082748,
|
||||
"tag_name": "v0.18.0-desktop.2",
|
||||
"html_url": "https://github.com/docker/buildx-desktop/releases/tag/v0.18.0-desktop.2",
|
||||
"assets": [
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.18.0-desktop.2/buildx-v0.18.0-desktop.2.darwin-amd64",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.18.0-desktop.2/buildx-v0.18.0-desktop.2.darwin-amd64.provenance.json",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.18.0-desktop.2/buildx-v0.18.0-desktop.2.darwin-amd64.sbom.json",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.18.0-desktop.2/buildx-v0.18.0-desktop.2.darwin-arm64",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.18.0-desktop.2/buildx-v0.18.0-desktop.2.darwin-arm64.provenance.json",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.18.0-desktop.2/buildx-v0.18.0-desktop.2.darwin-arm64.sbom.json",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.18.0-desktop.2/buildx-v0.18.0-desktop.2.linux-amd64",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.18.0-desktop.2/buildx-v0.18.0-desktop.2.linux-amd64.provenance.json",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.18.0-desktop.2/buildx-v0.18.0-desktop.2.linux-amd64.sbom.json",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.18.0-desktop.2/buildx-v0.18.0-desktop.2.linux-arm-v6",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.18.0-desktop.2/buildx-v0.18.0-desktop.2.linux-arm-v6.provenance.json",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.18.0-desktop.2/buildx-v0.18.0-desktop.2.linux-arm-v6.sbom.json",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.18.0-desktop.2/buildx-v0.18.0-desktop.2.linux-arm-v7",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.18.0-desktop.2/buildx-v0.18.0-desktop.2.linux-arm-v7.provenance.json",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.18.0-desktop.2/buildx-v0.18.0-desktop.2.linux-arm-v7.sbom.json",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.18.0-desktop.2/buildx-v0.18.0-desktop.2.linux-arm64",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.18.0-desktop.2/buildx-v0.18.0-desktop.2.linux-arm64.provenance.json",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.18.0-desktop.2/buildx-v0.18.0-desktop.2.linux-arm64.sbom.json",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.18.0-desktop.2/buildx-v0.18.0-desktop.2.linux-ppc64le",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.18.0-desktop.2/buildx-v0.18.0-desktop.2.linux-ppc64le.provenance.json",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.18.0-desktop.2/buildx-v0.18.0-desktop.2.linux-ppc64le.sbom.json",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.18.0-desktop.2/buildx-v0.18.0-desktop.2.linux-riscv64",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.18.0-desktop.2/buildx-v0.18.0-desktop.2.linux-riscv64.provenance.json",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.18.0-desktop.2/buildx-v0.18.0-desktop.2.linux-riscv64.sbom.json",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.18.0-desktop.2/buildx-v0.18.0-desktop.2.linux-s390x",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.18.0-desktop.2/buildx-v0.18.0-desktop.2.linux-s390x.provenance.json",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.18.0-desktop.2/buildx-v0.18.0-desktop.2.linux-s390x.sbom.json",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.18.0-desktop.2/buildx-v0.18.0-desktop.2.windows-amd64.exe",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.18.0-desktop.2/buildx-v0.18.0-desktop.2.windows-amd64.provenance.json",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.18.0-desktop.2/buildx-v0.18.0-desktop.2.windows-amd64.sbom.json",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.18.0-desktop.2/buildx-v0.18.0-desktop.2.windows-arm64.exe",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.18.0-desktop.2/buildx-v0.18.0-desktop.2.windows-arm64.provenance.json",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.18.0-desktop.2/buildx-v0.18.0-desktop.2.windows-arm64.sbom.json",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.18.0-desktop.2/checksums.txt"
|
||||
]
|
||||
},
|
||||
"v0.17.1-desktop.1": {
|
||||
"id": 174998914,
|
||||
"tag_name": "v0.17.1-desktop.1",
|
||||
|
||||
115
.github/buildx-releases.json
vendored
115
.github/buildx-releases.json
vendored
@@ -1,43 +1,84 @@
|
||||
{
|
||||
"latest": {
|
||||
"id": 174985224,
|
||||
"tag_name": "v0.17.1",
|
||||
"html_url": "https://github.com/docker/buildx/releases/tag/v0.17.1",
|
||||
"id": 182806222,
|
||||
"tag_name": "v0.18.0",
|
||||
"html_url": "https://github.com/docker/buildx/releases/tag/v0.18.0",
|
||||
"assets": [
|
||||
"https://github.com/docker/buildx/releases/download/v0.17.1/buildx-v0.17.1.darwin-amd64",
|
||||
"https://github.com/docker/buildx/releases/download/v0.17.1/buildx-v0.17.1.darwin-amd64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.17.1/buildx-v0.17.1.darwin-amd64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.17.1/buildx-v0.17.1.darwin-arm64",
|
||||
"https://github.com/docker/buildx/releases/download/v0.17.1/buildx-v0.17.1.darwin-arm64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.17.1/buildx-v0.17.1.darwin-arm64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.17.1/buildx-v0.17.1.linux-amd64",
|
||||
"https://github.com/docker/buildx/releases/download/v0.17.1/buildx-v0.17.1.linux-amd64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.17.1/buildx-v0.17.1.linux-amd64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.17.1/buildx-v0.17.1.linux-arm-v6",
|
||||
"https://github.com/docker/buildx/releases/download/v0.17.1/buildx-v0.17.1.linux-arm-v6.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.17.1/buildx-v0.17.1.linux-arm-v6.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.17.1/buildx-v0.17.1.linux-arm-v7",
|
||||
"https://github.com/docker/buildx/releases/download/v0.17.1/buildx-v0.17.1.linux-arm-v7.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.17.1/buildx-v0.17.1.linux-arm-v7.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.17.1/buildx-v0.17.1.linux-arm64",
|
||||
"https://github.com/docker/buildx/releases/download/v0.17.1/buildx-v0.17.1.linux-arm64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.17.1/buildx-v0.17.1.linux-arm64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.17.1/buildx-v0.17.1.linux-ppc64le",
|
||||
"https://github.com/docker/buildx/releases/download/v0.17.1/buildx-v0.17.1.linux-ppc64le.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.17.1/buildx-v0.17.1.linux-ppc64le.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.17.1/buildx-v0.17.1.linux-riscv64",
|
||||
"https://github.com/docker/buildx/releases/download/v0.17.1/buildx-v0.17.1.linux-riscv64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.17.1/buildx-v0.17.1.linux-riscv64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.17.1/buildx-v0.17.1.linux-s390x",
|
||||
"https://github.com/docker/buildx/releases/download/v0.17.1/buildx-v0.17.1.linux-s390x.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.17.1/buildx-v0.17.1.linux-s390x.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.17.1/buildx-v0.17.1.windows-amd64.exe",
|
||||
"https://github.com/docker/buildx/releases/download/v0.17.1/buildx-v0.17.1.windows-amd64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.17.1/buildx-v0.17.1.windows-amd64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.17.1/buildx-v0.17.1.windows-arm64.exe",
|
||||
"https://github.com/docker/buildx/releases/download/v0.17.1/buildx-v0.17.1.windows-arm64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.17.1/buildx-v0.17.1.windows-arm64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.17.1/checksums.txt"
|
||||
"https://github.com/docker/buildx/releases/download/v0.18.0/buildx-v0.18.0.darwin-amd64",
|
||||
"https://github.com/docker/buildx/releases/download/v0.18.0/buildx-v0.18.0.darwin-amd64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.18.0/buildx-v0.18.0.darwin-amd64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.18.0/buildx-v0.18.0.darwin-arm64",
|
||||
"https://github.com/docker/buildx/releases/download/v0.18.0/buildx-v0.18.0.darwin-arm64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.18.0/buildx-v0.18.0.darwin-arm64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.18.0/buildx-v0.18.0.linux-amd64",
|
||||
"https://github.com/docker/buildx/releases/download/v0.18.0/buildx-v0.18.0.linux-amd64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.18.0/buildx-v0.18.0.linux-amd64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.18.0/buildx-v0.18.0.linux-arm-v6",
|
||||
"https://github.com/docker/buildx/releases/download/v0.18.0/buildx-v0.18.0.linux-arm-v6.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.18.0/buildx-v0.18.0.linux-arm-v6.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.18.0/buildx-v0.18.0.linux-arm-v7",
|
||||
"https://github.com/docker/buildx/releases/download/v0.18.0/buildx-v0.18.0.linux-arm-v7.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.18.0/buildx-v0.18.0.linux-arm-v7.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.18.0/buildx-v0.18.0.linux-arm64",
|
||||
"https://github.com/docker/buildx/releases/download/v0.18.0/buildx-v0.18.0.linux-arm64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.18.0/buildx-v0.18.0.linux-arm64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.18.0/buildx-v0.18.0.linux-ppc64le",
|
||||
"https://github.com/docker/buildx/releases/download/v0.18.0/buildx-v0.18.0.linux-ppc64le.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.18.0/buildx-v0.18.0.linux-ppc64le.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.18.0/buildx-v0.18.0.linux-riscv64",
|
||||
"https://github.com/docker/buildx/releases/download/v0.18.0/buildx-v0.18.0.linux-riscv64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.18.0/buildx-v0.18.0.linux-riscv64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.18.0/buildx-v0.18.0.linux-s390x",
|
||||
"https://github.com/docker/buildx/releases/download/v0.18.0/buildx-v0.18.0.linux-s390x.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.18.0/buildx-v0.18.0.linux-s390x.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.18.0/buildx-v0.18.0.windows-amd64.exe",
|
||||
"https://github.com/docker/buildx/releases/download/v0.18.0/buildx-v0.18.0.windows-amd64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.18.0/buildx-v0.18.0.windows-amd64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.18.0/buildx-v0.18.0.windows-arm64.exe",
|
||||
"https://github.com/docker/buildx/releases/download/v0.18.0/buildx-v0.18.0.windows-arm64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.18.0/buildx-v0.18.0.windows-arm64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.18.0/checksums.txt"
|
||||
]
|
||||
},
|
||||
"v0.18.0": {
|
||||
"id": 182806222,
|
||||
"tag_name": "v0.18.0",
|
||||
"html_url": "https://github.com/docker/buildx/releases/tag/v0.18.0",
|
||||
"assets": [
|
||||
"https://github.com/docker/buildx/releases/download/v0.18.0/buildx-v0.18.0.darwin-amd64",
|
||||
"https://github.com/docker/buildx/releases/download/v0.18.0/buildx-v0.18.0.darwin-amd64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.18.0/buildx-v0.18.0.darwin-amd64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.18.0/buildx-v0.18.0.darwin-arm64",
|
||||
"https://github.com/docker/buildx/releases/download/v0.18.0/buildx-v0.18.0.darwin-arm64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.18.0/buildx-v0.18.0.darwin-arm64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.18.0/buildx-v0.18.0.linux-amd64",
|
||||
"https://github.com/docker/buildx/releases/download/v0.18.0/buildx-v0.18.0.linux-amd64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.18.0/buildx-v0.18.0.linux-amd64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.18.0/buildx-v0.18.0.linux-arm-v6",
|
||||
"https://github.com/docker/buildx/releases/download/v0.18.0/buildx-v0.18.0.linux-arm-v6.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.18.0/buildx-v0.18.0.linux-arm-v6.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.18.0/buildx-v0.18.0.linux-arm-v7",
|
||||
"https://github.com/docker/buildx/releases/download/v0.18.0/buildx-v0.18.0.linux-arm-v7.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.18.0/buildx-v0.18.0.linux-arm-v7.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.18.0/buildx-v0.18.0.linux-arm64",
|
||||
"https://github.com/docker/buildx/releases/download/v0.18.0/buildx-v0.18.0.linux-arm64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.18.0/buildx-v0.18.0.linux-arm64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.18.0/buildx-v0.18.0.linux-ppc64le",
|
||||
"https://github.com/docker/buildx/releases/download/v0.18.0/buildx-v0.18.0.linux-ppc64le.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.18.0/buildx-v0.18.0.linux-ppc64le.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.18.0/buildx-v0.18.0.linux-riscv64",
|
||||
"https://github.com/docker/buildx/releases/download/v0.18.0/buildx-v0.18.0.linux-riscv64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.18.0/buildx-v0.18.0.linux-riscv64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.18.0/buildx-v0.18.0.linux-s390x",
|
||||
"https://github.com/docker/buildx/releases/download/v0.18.0/buildx-v0.18.0.linux-s390x.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.18.0/buildx-v0.18.0.linux-s390x.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.18.0/buildx-v0.18.0.windows-amd64.exe",
|
||||
"https://github.com/docker/buildx/releases/download/v0.18.0/buildx-v0.18.0.windows-amd64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.18.0/buildx-v0.18.0.windows-amd64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.18.0/buildx-v0.18.0.windows-arm64.exe",
|
||||
"https://github.com/docker/buildx/releases/download/v0.18.0/buildx-v0.18.0.windows-arm64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.18.0/buildx-v0.18.0.windows-arm64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.18.0/checksums.txt"
|
||||
]
|
||||
},
|
||||
"v0.18.0-rc3": {
|
||||
|
||||
4
.github/workflows/test.yml
vendored
4
.github/workflows/test.yml
vendored
@@ -15,8 +15,8 @@ on:
|
||||
|
||||
env:
|
||||
NODE_VERSION: "20"
|
||||
BUILDX_VERSION: "v0.17.1"
|
||||
BUILDKIT_IMAGE: "moby/buildkit:v0.16.0"
|
||||
BUILDX_VERSION: "v0.18.0"
|
||||
BUILDKIT_IMAGE: "moby/buildkit:v0.17.0"
|
||||
|
||||
jobs:
|
||||
test:
|
||||
|
||||
@@ -48,35 +48,77 @@ aarch64:https://cloud.debian.org/images/cloud/bookworm/20231013-1532/debian-12-g
|
||||
{type: 'archive', version: 'latest', channel: 'stable'} as InstallSourceArchive,
|
||||
])(
|
||||
'install docker %s', async (source) => {
|
||||
if (process.env.ImageOS && process.env.ImageOS.startsWith('ubuntu')) {
|
||||
// Remove containerd first on ubuntu runners to make sure it takes
|
||||
// ones packaged with docker
|
||||
await Exec.exec('sudo', ['apt-get', 'remove', '-y', 'containerd.io'], {
|
||||
env: Object.assign({}, process.env, {
|
||||
DEBIAN_FRONTEND: 'noninteractive'
|
||||
}) as {
|
||||
[key: string]: string;
|
||||
}
|
||||
});
|
||||
}
|
||||
await ensureNoSystemContainerd();
|
||||
const install = new Install({
|
||||
source: source,
|
||||
runDir: tmpDir,
|
||||
contextName: 'foo',
|
||||
daemonConfig: `{"debug":true,"features":{"containerd-snapshotter":true}}`
|
||||
});
|
||||
await expect((async () => {
|
||||
try {
|
||||
await install.download();
|
||||
await install.install();
|
||||
await Docker.printVersion();
|
||||
await Docker.printInfo();
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
throw error;
|
||||
} finally {
|
||||
await install.tearDown();
|
||||
}
|
||||
})()).resolves.not.toThrow();
|
||||
await expect(tryInstall(install)).resolves.not.toThrow();
|
||||
}, 30 * 60 * 1000);
|
||||
});
|
||||
|
||||
describe('rootless', () => {
|
||||
// prettier-ignore
|
||||
test.each([
|
||||
{type: 'image', tag: 'latest'} as InstallSourceImage,
|
||||
{type: 'archive', version: 'latest', channel: 'stable'} as InstallSourceArchive,
|
||||
])(
|
||||
'install %s', async (source) => {
|
||||
// Skip on non linux
|
||||
if (os.platform() !== 'linux') {
|
||||
return;
|
||||
}
|
||||
|
||||
await ensureNoSystemContainerd();
|
||||
const install = new Install({
|
||||
source: source,
|
||||
runDir: tmpDir,
|
||||
contextName: 'foo',
|
||||
daemonConfig: `{"debug":true}`,
|
||||
rootless: true
|
||||
});
|
||||
await expect(
|
||||
tryInstall(install, async () => {
|
||||
const out = await Docker.getExecOutput(['info', '-f', '{{json .SecurityOptions}}']);
|
||||
expect(out.exitCode).toBe(0);
|
||||
expect(out.stderr.trim()).toBe('');
|
||||
expect(out.stdout.trim()).toContain('rootless');
|
||||
})
|
||||
).resolves.not.toThrow();
|
||||
},
|
||||
30 * 60 * 1000
|
||||
);
|
||||
});
|
||||
|
||||
async function tryInstall(install: Install, extraCheck?: () => Promise<void>): Promise<void> {
|
||||
try {
|
||||
await install.download();
|
||||
await install.install();
|
||||
await Docker.printVersion();
|
||||
await Docker.printInfo();
|
||||
if (extraCheck) {
|
||||
await extraCheck();
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
throw error;
|
||||
} finally {
|
||||
await install.tearDown();
|
||||
}
|
||||
}
|
||||
|
||||
async function ensureNoSystemContainerd() {
|
||||
if (process.env.ImageOS && process.env.ImageOS.startsWith('ubuntu')) {
|
||||
// Remove containerd first on ubuntu runners to make sure it takes
|
||||
// ones packaged with docker
|
||||
await Exec.exec('sudo', ['apt-get', 'remove', '-y', 'containerd.io'], {
|
||||
env: Object.assign({}, process.env, {
|
||||
DEBIAN_FRONTEND: 'noninteractive'
|
||||
}) as {
|
||||
[key: string]: string;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
ARG NODE_VERSION=20
|
||||
ARG DOCKER_VERSION=27.2.1
|
||||
ARG BUILDX_VERSION=0.17.1
|
||||
ARG BUILDX_VERSION=0.18.0
|
||||
ARG UNDOCK_VERSION=0.8.0
|
||||
|
||||
FROM node:${NODE_VERSION}-alpine AS base
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@actions/artifact": "^2.1.11",
|
||||
"@actions/cache": "^3.2.4",
|
||||
"@actions/cache": "^3.3.0",
|
||||
"@actions/core": "^1.11.1",
|
||||
"@actions/exec": "^1.1.1",
|
||||
"@actions/github": "^6.0.0",
|
||||
|
||||
@@ -21,7 +21,6 @@ import os from 'os';
|
||||
import path from 'path';
|
||||
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';
|
||||
@@ -56,6 +55,7 @@ export interface InstallOpts {
|
||||
runDir: string;
|
||||
contextName?: string;
|
||||
daemonConfig?: string;
|
||||
rootless?: boolean;
|
||||
}
|
||||
|
||||
interface LimaImage {
|
||||
@@ -65,12 +65,13 @@ interface LimaImage {
|
||||
}
|
||||
|
||||
export class Install {
|
||||
private readonly runDir: string;
|
||||
private runDir: string;
|
||||
private readonly source: InstallSource;
|
||||
private readonly contextName: string;
|
||||
private readonly daemonConfig?: string;
|
||||
private _version: string | undefined;
|
||||
private _toolDir: string | undefined;
|
||||
private rootless: boolean;
|
||||
|
||||
private gitCommit: string | undefined;
|
||||
|
||||
@@ -78,6 +79,7 @@ export class Install {
|
||||
|
||||
constructor(opts: InstallOpts) {
|
||||
this.runDir = opts.runDir;
|
||||
this.rootless = opts.rootless || false;
|
||||
this.source = opts.source || {
|
||||
type: 'archive',
|
||||
version: 'latest',
|
||||
@@ -91,25 +93,25 @@ export class Install {
|
||||
return this._toolDir || Context.tmpDir();
|
||||
}
|
||||
|
||||
async downloadStaticArchive(src: InstallSourceArchive): Promise<string> {
|
||||
async downloadStaticArchive(component: 'docker' | 'docker-rootless-extras', src: InstallSourceArchive): Promise<string> {
|
||||
const release: GitHubRelease = await Install.getRelease(src.version);
|
||||
this._version = release.tag_name.replace(/^v+|v+$/g, '');
|
||||
core.debug(`docker.Install.download version: ${this._version}`);
|
||||
|
||||
const downloadURL = this.downloadURL(this._version, src.channel);
|
||||
const downloadURL = this.downloadURL(component, this._version, src.channel);
|
||||
core.info(`Downloading ${downloadURL}`);
|
||||
|
||||
const downloadPath = await tc.downloadTool(downloadURL);
|
||||
core.debug(`docker.Install.download downloadPath: ${downloadPath}`);
|
||||
|
||||
let extractFolder: string;
|
||||
let extractFolder;
|
||||
if (os.platform() == 'win32') {
|
||||
extractFolder = await tc.extractZip(downloadPath);
|
||||
extractFolder = await tc.extractZip(downloadPath, extractFolder);
|
||||
} else {
|
||||
extractFolder = await tc.extractTar(downloadPath);
|
||||
extractFolder = await tc.extractTar(downloadPath, extractFolder);
|
||||
}
|
||||
if (Util.isDirectory(path.join(extractFolder, 'docker'))) {
|
||||
extractFolder = path.join(extractFolder, 'docker');
|
||||
if (Util.isDirectory(path.join(extractFolder, component))) {
|
||||
extractFolder = path.join(extractFolder, component);
|
||||
}
|
||||
core.debug(`docker.Install.download extractFolder: ${extractFolder}`);
|
||||
return extractFolder;
|
||||
@@ -164,7 +166,12 @@ export class Install {
|
||||
this._version = version;
|
||||
|
||||
core.info(`Downloading Docker ${version} from ${this.source.channel} at download.docker.com`);
|
||||
extractFolder = await this.downloadStaticArchive(this.source);
|
||||
extractFolder = await this.downloadStaticArchive('docker', this.source);
|
||||
if (this.rootless) {
|
||||
core.info(`Downloading Docker rootless extras ${version} from ${this.source.channel} at download.docker.com`);
|
||||
const extrasFolder = await this.downloadStaticArchive('docker-rootless-extras', this.source);
|
||||
fs.copyFileSync(path.join(extrasFolder, 'dockerd-rootless.sh'), path.join(extractFolder, 'dockerd-rootless.sh'));
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -195,7 +202,13 @@ export class Install {
|
||||
if (!this.runDir) {
|
||||
throw new Error('runDir must be set');
|
||||
}
|
||||
switch (os.platform()) {
|
||||
|
||||
const platform = os.platform();
|
||||
if (this.rootless && platform != 'linux') {
|
||||
// TODO: Support on macOS (via lima)
|
||||
throw new Error(`rootless is only supported on linux`);
|
||||
}
|
||||
switch (platform) {
|
||||
case 'darwin': {
|
||||
return await this.installDarwin();
|
||||
}
|
||||
@@ -339,21 +352,34 @@ export class Install {
|
||||
}
|
||||
|
||||
const envs = Object.assign({}, process.env, {
|
||||
PATH: `${this.toolDir}:${process.env.PATH}`
|
||||
PATH: `${this.toolDir}:${process.env.PATH}`,
|
||||
XDG_RUNTIME_DIR: (this.rootless && this.runDir) || undefined
|
||||
}) as {
|
||||
[key: string]: string;
|
||||
};
|
||||
|
||||
await core.group('Start Docker daemon', async () => {
|
||||
const bashPath: string = await io.which('bash', true);
|
||||
const cmd = `${this.toolDir}/dockerd --host="${dockerHost}" --config-file="${daemonConfigPath}" --exec-root="${this.runDir}/execroot" --data-root="${this.runDir}/data" --pidfile="${this.runDir}/docker.pid" --userland-proxy=false`;
|
||||
let dockerPath = `${this.toolDir}/dockerd`;
|
||||
if (this.rootless) {
|
||||
dockerPath = `${this.toolDir}/dockerd-rootless.sh`;
|
||||
if (fs.existsSync('/proc/sys/kernel/apparmor_restrict_unprivileged_userns')) {
|
||||
await Exec.exec('sudo', ['sh', '-c', 'echo 0 > /proc/sys/kernel/apparmor_restrict_unprivileged_userns']);
|
||||
}
|
||||
}
|
||||
|
||||
const cmd = `${dockerPath} --host="${dockerHost}" --config-file="${daemonConfigPath}" --exec-root="${this.runDir}/execroot" --data-root="${this.runDir}/data" --pidfile="${this.runDir}/docker.pid"`;
|
||||
core.info(`[command] ${cmd}`); // https://github.com/actions/toolkit/blob/3d652d3133965f63309e4b2e1c8852cdbdcb3833/packages/exec/src/toolrunner.ts#L47
|
||||
let sudo = 'sudo';
|
||||
if (this.rootless) {
|
||||
sudo += ' -u \\#1001';
|
||||
}
|
||||
const proc = await child_process.spawn(
|
||||
// We can't use Exec.exec here because we need to detach the process to
|
||||
// avoid killing it when the action finishes running. Even if detached,
|
||||
// we also need to run dockerd in a subshell and unref the process so
|
||||
// GitHub Action doesn't wait for it to finish.
|
||||
`sudo env "PATH=$PATH" ${bashPath} << EOF
|
||||
`${sudo} env "PATH=$PATH" ${bashPath} << EOF
|
||||
( ${cmd} 2>&1 | tee "${this.runDir}/dockerd.log" ) &
|
||||
EOF`,
|
||||
[],
|
||||
@@ -517,11 +543,11 @@ EOF`,
|
||||
});
|
||||
}
|
||||
|
||||
private downloadURL(version: string, channel: string): string {
|
||||
private downloadURL(component: 'docker' | 'docker-rootless-extras', version: string, channel: string): string {
|
||||
const platformOS = Install.platformOS();
|
||||
const platformArch = Install.platformArch();
|
||||
const ext = platformOS === 'win' ? '.zip' : '.tgz';
|
||||
return util.format('https://download.docker.com/%s/static/%s/%s/docker-%s%s', platformOS, channel, platformArch, version, ext);
|
||||
return `https://download.docker.com/${platformOS}/static/${channel}/${platformArch}/${component}-${version}${ext}`;
|
||||
}
|
||||
|
||||
private static platformOS(): string {
|
||||
|
||||
15
yarn.lock
15
yarn.lock
@@ -33,11 +33,11 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@actions/cache@npm:^3.2.4":
|
||||
version: 3.2.4
|
||||
resolution: "@actions/cache@npm:3.2.4"
|
||||
"@actions/cache@npm:^3.3.0":
|
||||
version: 3.3.0
|
||||
resolution: "@actions/cache@npm:3.3.0"
|
||||
dependencies:
|
||||
"@actions/core": ^1.10.0
|
||||
"@actions/core": ^1.11.1
|
||||
"@actions/exec": ^1.0.1
|
||||
"@actions/glob": ^0.1.0
|
||||
"@actions/http-client": ^2.1.1
|
||||
@@ -46,8 +46,7 @@ __metadata:
|
||||
"@azure/ms-rest-js": ^2.6.0
|
||||
"@azure/storage-blob": ^12.13.0
|
||||
semver: ^6.3.1
|
||||
uuid: ^3.3.3
|
||||
checksum: 5bf5f7541bea4906b553440a9ffee5699e11dfb729365c6cb0bbd37e147a1a0993369fdad16bfa3e2b01ec7fa57dac66276278bfd4a389009246a75ea953e61d
|
||||
checksum: f0761b1491b7706a80b44d68ed52eb48c04653fc939525a7c7b606e9d9251c40c7e4ac20846ab92ac32db6869e1a6f0f574bd6b7fec1ab9378c8e199c5acc9c9
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
@@ -1109,7 +1108,7 @@ __metadata:
|
||||
resolution: "@docker/actions-toolkit@workspace:."
|
||||
dependencies:
|
||||
"@actions/artifact": ^2.1.11
|
||||
"@actions/cache": ^3.2.4
|
||||
"@actions/cache": ^3.3.0
|
||||
"@actions/core": ^1.11.1
|
||||
"@actions/exec": ^1.1.1
|
||||
"@actions/github": ^6.0.0
|
||||
@@ -8363,7 +8362,7 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"uuid@npm:^3.3.2, uuid@npm:^3.3.3":
|
||||
"uuid@npm:^3.3.2":
|
||||
version: 3.4.0
|
||||
resolution: "uuid@npm:3.4.0"
|
||||
bin:
|
||||
|
||||
Reference in New Issue
Block a user