From cb85f4d2f4665cd9ed45227fea49179b5cc01f14 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 13 Mar 2025 14:12:37 +0000 Subject: [PATCH 01/33] docs: add extra step for QEMU issue --- README.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/README.md b/README.md index 55ff2fb..0724082 100644 --- a/README.md +++ b/README.md @@ -46,6 +46,29 @@ jobs: uses: step-security/ghaction-setup-docker@v3 ``` +> [!IMPORTANT] +> macOS runners hang with latest QEMU 9.1.0. You need to install QEMU 9.0.2 as +> a workaround: +> ```yaml +> name: ci +> +> on: +> push: +> +> jobs: +> docker: +> runs-on: macos-13 +> steps: +> - +> # https://github.com/crazy-max/ghaction-setup-docker/issues/108 +> name: Install QEMU 9.0.2 +> uses: docker/actions-toolkit/.github/actions/macos-setup-qemu@19ca9ade20f5da695f76a10988d6532058575f82 +> - +> name: Set up Docker +> uses: crazy-max/ghaction-setup-docker@v3 +> ``` +> More info: https://github.com/crazy-max/ghaction-setup-docker/issues/108. + ### Daemon configuration You can [configure the Docker daemon](https://docs.docker.com/engine/reference/commandline/dockerd/#daemon-configuration-file) From 4c711a6c32dbd7e9fd0a9912089aa29c23836a3b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 13 Mar 2025 14:12:39 +0000 Subject: [PATCH 02/33] chore: ignore docker/actions-toolkit deps with dependabot --- .github/dependabot.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 6bb7255..a22ad69 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -4,6 +4,11 @@ updates: directory: "/" schedule: interval: "daily" + ignore: + # ignore this dependency + # it seems a bug with dependabot as pining to commit sha should not + # trigger a new version similar to https://github.com/docker/buildx/pull/2222#issuecomment-1919092153 + - dependency-name: "docker/actions-toolkit" labels: - "dependencies" - "bot" From cdc50ddd08c3fe2fdbd4c8fc4b2c840a350c4b48 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 13 Mar 2025 14:12:47 +0000 Subject: [PATCH 03/33] remove uuid package and switch to crypto --- src/main.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.ts b/src/main.ts index f861851..49a10a0 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,6 +1,6 @@ +import * as crypto from 'crypto'; import os from 'os'; import path from 'path'; -import * as uuid from 'uuid'; import * as core from '@actions/core'; import * as actionsToolkit from '@docker/actions-toolkit'; import {Install} from '@docker/actions-toolkit/lib/docker/install'; @@ -31,7 +31,7 @@ actionsToolkit.run( await validateSubscription(); const input: context.Inputs = context.getInputs(); - const runDir = path.join(os.homedir(), `setup-docker-action-${uuid.v4().slice(0, 8)}`); + const runDir = path.join(os.homedir(), `setup-docker-action-${crypto.randomUUID().slice(0, 8)}`); if (input.context == 'default') { throw new Error(`'default' context cannot be used.`); From 5a693462ef779750fc13cfd4afc262bed500535f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 13 Mar 2025 14:12:51 +0000 Subject: [PATCH 04/33] changed signature for install method --- src/main.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main.ts b/src/main.ts index 49a10a0..1f2cd0a 100644 --- a/src/main.ts +++ b/src/main.ts @@ -39,8 +39,11 @@ actionsToolkit.run( const install = new Install({ runDir: runDir, - version: input.version, - channel: input.channel || 'stable', + source: { + type: 'archive', + version: input.version, + channel: input.channel || 'stable' + }, contextName: input.context || 'setup-docker-action', daemonConfig: input.daemonConfig }); From ccb944c8962dea61384dd92b42742a95f16f9bbf Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 13 Mar 2025 14:12:54 +0000 Subject: [PATCH 05/33] Support downloading binaries from docker images MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Paweł Gronowski --- __tests__/context.test.ts | 107 +++++++++++++++++++++++++++++++++++--- 1 file changed, 100 insertions(+), 7 deletions(-) diff --git a/__tests__/context.test.ts b/__tests__/context.test.ts index 5e813ac..0f0f79e 100644 --- a/__tests__/context.test.ts +++ b/__tests__/context.test.ts @@ -21,8 +21,11 @@ describe('getInputs', () => { ['set-host', 'false'], ]), { - version: 'v24.0.8', - channel: '', + source: { + type: 'archive', + version: 'v24.0.8', + channel: 'stable' + }, context: '', daemonConfig: '', setHost: false @@ -38,8 +41,11 @@ describe('getInputs', () => { ['set-host', 'false'], ]), { - version: 'v24.0.0-rc.4', - channel: 'test', + source: { + type: 'archive', + version: 'v24.0.0-rc.4', + channel: 'test' + }, context: 'foo', daemonConfig: `{"debug":true,"features":{"containerd-snapshotter":true}}`, setHost: false @@ -51,13 +57,100 @@ describe('getInputs', () => { ['set-host', 'true'], ]), { - version: 'latest', - channel: '', + source: { + type: 'archive', + version: 'latest', + channel: 'stable', + }, context: '', daemonConfig: '', setHost: true } as context.Inputs - ] + ], + [ + 3, + new Map([ + ['version', 'type=image,tag=master'], + ['context', 'foo'], + ['daemon-config', `{"debug":true,"features":{"containerd-snapshotter":true}}`], + ['set-host', 'false'], + ]), + { + source: { + type: 'image', + tag: 'master', + }, + context: 'foo', + daemonConfig: `{"debug":true,"features":{"containerd-snapshotter":true}}`, + setHost: false + } as context.Inputs + ], + [ + 4, + new Map([ + ['version', 'type=image'], + ['set-host', 'false'], + ]), + { + source: { + type: 'image', + tag: 'latest', + }, + context: '', + daemonConfig: '', + setHost: false + } as context.Inputs + ], + [ + 5, + new Map([ + ['version', 'type=archive'], + ['set-host', 'false'], + ]), + { + source: { + type: 'archive', + version: 'latest', + channel: 'stable', + }, + setHost: false, + context: '', + daemonConfig: '', + } as context.Inputs + ], + [ + 6, + new Map([ + ['version', 'version=v27.2.0,channel=test'], + ['set-host', 'false'], + ]), + { + source: { + type: 'archive', + version: 'v27.2.0', + channel: 'test', + }, + setHost: false, + context: '', + daemonConfig: '', + } as context.Inputs + ], + [ + 7, + new Map([ + ['version', 'type=image,tag=27.2.1'], + ['set-host', 'false'], + ]), + { + source: { + type: 'image', + tag: '27.2.1', + }, + setHost: false, + context: '', + daemonConfig: '', + } as context.Inputs + ], ])( '[%d] given %p as inputs, returns %p', async (num: number, inputs: Map, expected: context.Inputs) => { From db410e99efc958475a5986f71bd20f69d38bb911 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 13 Mar 2025 14:12:55 +0000 Subject: [PATCH 06/33] Support downloading binaries from docker images MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Paweł Gronowski --- src/context.ts | 85 +++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 81 insertions(+), 4 deletions(-) diff --git a/src/context.ts b/src/context.ts index 34ba9a7..7eb90fe 100644 --- a/src/context.ts +++ b/src/context.ts @@ -1,19 +1,96 @@ import * as core from '@actions/core'; +import {InstallSource} from '@docker/actions-toolkit/lib/docker/install'; +import {parse} from 'csv-parse/sync'; export interface Inputs { - version: string; - channel: string; + source: InstallSource; daemonConfig?: string; context: string; setHost: boolean; } export function getInputs(): Inputs { + const rawVersion = core.getInput('version') || 'latest'; + const source = parseSource(rawVersion); + const channel = core.getInput('channel'); + if (channel && source.type === 'archive') { + source.channel = channel; + } + return { - version: core.getInput('version') || 'latest', - channel: core.getInput('channel'), + source: source, daemonConfig: core.getInput('daemon-config'), context: core.getInput('context'), setHost: core.getBooleanInput('set-host') }; } + +function parseSource(input: string): InstallSource { + let [type, version, channel, tag] = ['archive', 'latest', 'stable', 'latest']; + + const fields = parse(input, { + relaxColumnCount: true, + skipEmptyLines: true + })[0]; + for (const field of fields) { + const parts = field + .toString() + .split(/(?<=^[^=]+?)=/) + .map(item => item.trim()); + + switch (parts[0]) { + case 'type': + type = parts[1]; + break; + case 'version': + version = parts[1]; + break; + case 'channel': + channel = parts[1]; + break; + case 'tag': + tag = parts[1]; + break; + default: + if (fields.length === 1) { + version = parts[0]; + break; + } + throw new Error(`Invalid field: ${parts[0]}`); + } + } + + if (!type) { + throw new Error(`Invalid type: ${type}`); + } + if (!channel) { + throw new Error(`Invalid channel: ${channel}`); + } + if (!version) { + throw new Error(`Invalid version: ${version}`); + } + if (!tag) { + throw new Error(`Invalid tag: ${tag}`); + } + + let src: InstallSource; + switch (type) { + case 'archive': + src = { + type: 'archive', + version: version, + channel: channel + }; + break; + case 'image': + src = { + type: 'image', + tag: tag + }; + break; + default: + throw new Error(`Invalid version: ${input}`); + } + + return src; +} From 1f1ca838d8f1f5928333df5816c9ed5c63d31fd8 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 13 Mar 2025 14:12:56 +0000 Subject: [PATCH 07/33] Support downloading binaries from docker images MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Paweł Gronowski --- src/main.ts | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/main.ts b/src/main.ts index 1f2cd0a..9b05a96 100644 --- a/src/main.ts +++ b/src/main.ts @@ -39,16 +39,12 @@ actionsToolkit.run( const install = new Install({ runDir: runDir, - source: { - type: 'archive', - version: input.version, - channel: input.channel || 'stable' - }, + source: input.source, contextName: input.context || 'setup-docker-action', daemonConfig: input.daemonConfig }); let toolDir; - if (!(await Docker.isAvailable()) || input.version) { + if (!(await Docker.isAvailable()) || input.source) { await core.group(`Download docker`, async () => { toolDir = await install.download(); }); From 1acd9f679de3940e46e169189f3852b9015a91a8 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 13 Mar 2025 14:13:07 +0000 Subject: [PATCH 08/33] Add rootless support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Wire up `rootless` config to the new `rootless` Install option. Signed-off-by: Paweł Gronowski --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 0724082..fc7edf6 100644 --- a/README.md +++ b/README.md @@ -134,6 +134,7 @@ The following inputs can be used as `step.with` keys | `daemon-config` | String | | [Docker daemon JSON configuration](https://docs.docker.com/engine/reference/commandline/dockerd/#daemon-configuration-file) | | `context` | String | `setup-docker-action` | Docker context name. | | `set-host` | Bool | `false` | Set `DOCKER_HOST` environment variable to docker socket path. | +| `rootless` | Bool | `false` | Start daemon in rootless mode | ### outputs From 5bf08cd94b8cf93718563c65d30fdc2bf53c25f4 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 13 Mar 2025 14:13:08 +0000 Subject: [PATCH 09/33] Add rootless support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Wire up `rootless` config to the new `rootless` Install option. Signed-off-by: Paweł Gronowski --- __tests__/context.test.ts | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/__tests__/context.test.ts b/__tests__/context.test.ts index 0f0f79e..585f28e 100644 --- a/__tests__/context.test.ts +++ b/__tests__/context.test.ts @@ -19,6 +19,7 @@ describe('getInputs', () => { new Map([ ['version', 'v24.0.8'], ['set-host', 'false'], + ['rootless', 'false'], ]), { source: { @@ -28,6 +29,7 @@ describe('getInputs', () => { }, context: '', daemonConfig: '', + rootless: false, setHost: false } as context.Inputs ], @@ -39,6 +41,7 @@ describe('getInputs', () => { ['context', 'foo'], ['daemon-config', `{"debug":true,"features":{"containerd-snapshotter":true}}`], ['set-host', 'false'], + ['rootless', 'false'], ]), { source: { @@ -48,6 +51,7 @@ describe('getInputs', () => { }, context: 'foo', daemonConfig: `{"debug":true,"features":{"containerd-snapshotter":true}}`, + rootless: false, setHost: false } as context.Inputs ], @@ -55,6 +59,7 @@ describe('getInputs', () => { 2, new Map([ ['set-host', 'true'], + ['rootless', 'false'], ]), { source: { @@ -64,6 +69,7 @@ describe('getInputs', () => { }, context: '', daemonConfig: '', + rootless: false, setHost: true } as context.Inputs ], @@ -74,6 +80,7 @@ describe('getInputs', () => { ['context', 'foo'], ['daemon-config', `{"debug":true,"features":{"containerd-snapshotter":true}}`], ['set-host', 'false'], + ['rootless', 'false'], ]), { source: { @@ -82,6 +89,7 @@ describe('getInputs', () => { }, context: 'foo', daemonConfig: `{"debug":true,"features":{"containerd-snapshotter":true}}`, + rootless: false, setHost: false } as context.Inputs ], @@ -90,6 +98,7 @@ describe('getInputs', () => { new Map([ ['version', 'type=image'], ['set-host', 'false'], + ['rootless', 'false'], ]), { source: { @@ -98,6 +107,7 @@ describe('getInputs', () => { }, context: '', daemonConfig: '', + rootless: false, setHost: false } as context.Inputs ], @@ -106,6 +116,7 @@ describe('getInputs', () => { new Map([ ['version', 'type=archive'], ['set-host', 'false'], + ['rootless', 'false'], ]), { source: { @@ -116,6 +127,7 @@ describe('getInputs', () => { setHost: false, context: '', daemonConfig: '', + rootless: false, } as context.Inputs ], [ @@ -123,6 +135,7 @@ describe('getInputs', () => { new Map([ ['version', 'version=v27.2.0,channel=test'], ['set-host', 'false'], + ['rootless', 'false'], ]), { source: { @@ -133,6 +146,7 @@ describe('getInputs', () => { setHost: false, context: '', daemonConfig: '', + rootless: false, } as context.Inputs ], [ @@ -140,6 +154,7 @@ describe('getInputs', () => { new Map([ ['version', 'type=image,tag=27.2.1'], ['set-host', 'false'], + ['rootless', 'false'], ]), { source: { @@ -149,6 +164,25 @@ describe('getInputs', () => { setHost: false, context: '', daemonConfig: '', + rootless: false, + } as context.Inputs + ], + [ + 8, + new Map([ + ['version', 'type=image,tag=27.2.1'], + ['set-host', 'false'], + ['rootless', 'true'] + ]), + { + source: { + type: 'image', + tag: '27.2.1', + }, + setHost: false, + context: '', + daemonConfig: '', + rootless: true, } as context.Inputs ], ])( From 6bd25443e1bd31d33baf9a908cf6a02c71cceced Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 13 Mar 2025 14:13:09 +0000 Subject: [PATCH 10/33] Add rootless support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Wire up `rootless` config to the new `rootless` Install option. Signed-off-by: Paweł Gronowski --- action.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/action.yml b/action.yml index 3518588..5c553c1 100644 --- a/action.yml +++ b/action.yml @@ -23,6 +23,10 @@ inputs: description: 'Set DOCKER_HOST environment variable to docker socket path' default: 'false' required: false + rootless: + description: 'Enable Docker rootless mode' + default: 'false' + required: false outputs: sock: From 39b27ef791da835180323d466ceb2fee1a9d3cbd Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 13 Mar 2025 14:13:10 +0000 Subject: [PATCH 11/33] Add rootless support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Wire up `rootless` config to the new `rootless` Install option. Signed-off-by: Paweł Gronowski --- src/context.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/context.ts b/src/context.ts index 7eb90fe..70fb2cb 100644 --- a/src/context.ts +++ b/src/context.ts @@ -7,6 +7,7 @@ export interface Inputs { daemonConfig?: string; context: string; setHost: boolean; + rootless: boolean; } export function getInputs(): Inputs { @@ -21,7 +22,8 @@ export function getInputs(): Inputs { source: source, daemonConfig: core.getInput('daemon-config'), context: core.getInput('context'), - setHost: core.getBooleanInput('set-host') + setHost: core.getBooleanInput('set-host'), + rootless: core.getBooleanInput('rootless') }; } From f473fdb0f0754982a98ecd19d90fc3fe2cb6dde0 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 13 Mar 2025 14:13:11 +0000 Subject: [PATCH 12/33] Add rootless support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Wire up `rootless` config to the new `rootless` Install option. Signed-off-by: Paweł Gronowski --- src/main.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main.ts b/src/main.ts index 9b05a96..82e5c11 100644 --- a/src/main.ts +++ b/src/main.ts @@ -40,6 +40,7 @@ actionsToolkit.run( const install = new Install({ runDir: runDir, source: input.source, + rootless: input.rootless, contextName: input.context || 'setup-docker-action', daemonConfig: input.daemonConfig }); From 49feb217e1f44711cfdab5d9b072a05687c569ef Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 13 Mar 2025 14:13:25 +0000 Subject: [PATCH 13/33] readme: remove qemu set up workaround --- README.md | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/README.md b/README.md index fc7edf6..f9e8ae0 100644 --- a/README.md +++ b/README.md @@ -46,29 +46,6 @@ jobs: uses: step-security/ghaction-setup-docker@v3 ``` -> [!IMPORTANT] -> macOS runners hang with latest QEMU 9.1.0. You need to install QEMU 9.0.2 as -> a workaround: -> ```yaml -> name: ci -> -> on: -> push: -> -> jobs: -> docker: -> runs-on: macos-13 -> steps: -> - -> # https://github.com/crazy-max/ghaction-setup-docker/issues/108 -> name: Install QEMU 9.0.2 -> uses: docker/actions-toolkit/.github/actions/macos-setup-qemu@19ca9ade20f5da695f76a10988d6532058575f82 -> - -> name: Set up Docker -> uses: crazy-max/ghaction-setup-docker@v3 -> ``` -> More info: https://github.com/crazy-max/ghaction-setup-docker/issues/108. - ### Daemon configuration You can [configure the Docker daemon](https://docs.docker.com/engine/reference/commandline/dockerd/#daemon-configuration-file) From 8d32d81e5d5d2a73deab8bc0c6f7ba65fe8b6b5b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 13 Mar 2025 14:13:30 +0000 Subject: [PATCH 14/33] chore: github form templates --- .github/ISSUE_TEMPLATE/bug_report.md | 34 ---------------------------- 1 file changed, 34 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index d50d109..e69de29 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -1,34 +0,0 @@ ---- -name: Bug report -about: Create a report to help us improve ---- - -### Behaviour - -#### Steps to reproduce this issue - -1. -2. -3. - -#### Expected behaviour - -> Tell us what should happen - -#### Actual behaviour - -> Tell us what happens instead - -### Configuration - -* Repository URL (if public): -* Build URL (if public): - -```yml -# paste your YAML workflow file here and remove sensitive data -``` - -### Logs - -> Download the [log file of your build](https://docs.github.com/en/actions/managing-workflow-runs/using-workflow-run-logs#downloading-logs) -> and [attach it](https://docs.github.com/en/github/managing-your-work-on-github/file-attachments-on-issues-and-pull-requests) to this issue. From 5584fb8faeeedaf820b524c27ca4112ff42312c9 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 13 Mar 2025 14:13:32 +0000 Subject: [PATCH 15/33] docs: note about action usage --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index f9e8ae0..9bbedaa 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,13 @@ GitHub Action to set up (download and install) [Docker CE](https://docs.docker.com/engine/). Works on Linux, macOS and Windows. +> [!NOTE] +> This action is useful if you want to pin against a specific Docker version or +> set up a custom daemon configuration or if Docker is not available on your +> runner. If you're using [GitHub-hosted runners](https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources) +> on Linux or Windows, Docker is already up and running, so it might not be +> necessary to use this action. + > [!WARNING] > Does not work on macOS runners with ARM architecture (no nested virtualization): > * https://github.com/docker/actions-toolkit/issues/317 From aafb4387d33769d261851b1da661dfa320f63d8a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 13 Mar 2025 14:13:45 +0000 Subject: [PATCH 16/33] tcp-port opt to expose Docker API to a local TCP address --- README.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 9bbedaa..264df07 100644 --- a/README.md +++ b/README.md @@ -116,6 +116,7 @@ The following inputs can be used as `step.with` keys | `version` | String | `latest` | Docker CE version (e.g., `v24.0.6`). | | `channel` | String | `stable` | Docker CE [channel](https://download.docker.com/linux/static/) (e.g, `stable`, `edge` or `test`). | | `daemon-config` | String | | [Docker daemon JSON configuration](https://docs.docker.com/engine/reference/commandline/dockerd/#daemon-configuration-file) | +| `tcp-port` | Number | | TCP port to expose the Docker API locally | | `context` | String | `setup-docker-action` | Docker context name. | | `set-host` | Bool | `false` | Set `DOCKER_HOST` environment variable to docker socket path. | | `rootless` | Bool | `false` | Start daemon in rootless mode | @@ -124,9 +125,10 @@ The following inputs can be used as `step.with` keys The following outputs are available -| Name | Type | Description | -|--------|--------|--------------------| -| `sock` | String | Docker socket path | +| Name | Type | Description | +|--------|--------|---------------------------------------| +| `sock` | String | Docker socket path | +| `tcp` | String | Docker TCP address if tcp-port is set | ## License From f4ed3aed9aebdfdf78be4d94a883ed67cdd1f61c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 13 Mar 2025 14:13:45 +0000 Subject: [PATCH 17/33] tcp-port opt to expose Docker API to a local TCP address --- __tests__/context.test.ts | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/__tests__/context.test.ts b/__tests__/context.test.ts index 585f28e..868b17e 100644 --- a/__tests__/context.test.ts +++ b/__tests__/context.test.ts @@ -185,6 +185,27 @@ describe('getInputs', () => { rootless: true, } as context.Inputs ], + [ + 9, + new Map([ + ['version', 'v24.0.8'], + ['tcp-port', '2378'], + ['set-host', 'false'], + ['rootless', 'false'], + ]), + { + source: { + type: 'archive', + version: 'v24.0.8', + channel: 'stable' + }, + context: '', + daemonConfig: '', + tcpPort: 2378, + rootless: false, + setHost: false + } as context.Inputs + ], ])( '[%d] given %p as inputs, returns %p', async (num: number, inputs: Map, expected: context.Inputs) => { From f17a798d0ebe55d627b7102f766f746d97b0e096 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 13 Mar 2025 14:13:46 +0000 Subject: [PATCH 18/33] tcp-port opt to expose Docker API to a local TCP address --- action.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/action.yml b/action.yml index 5c553c1..b618556 100644 --- a/action.yml +++ b/action.yml @@ -16,6 +16,9 @@ inputs: daemon-config: description: 'Docker daemon JSON configuration' required: false + tcp-port: + description: 'TCP port to expose the Docker API locally' + required: false context: description: 'Docker context name. (default setup-docker-action)' required: false @@ -31,6 +34,8 @@ inputs: outputs: sock: description: "Docker socket path" + tcp: + description: "Docker TCP address if tcp-port is set" runs: using: 'node20' From 05e032deb7fdf01cb9df3c693f8ffdb228d7d535 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 13 Mar 2025 14:13:47 +0000 Subject: [PATCH 19/33] tcp-port opt to expose Docker API to a local TCP address --- src/context.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/context.ts b/src/context.ts index 70fb2cb..92c7b4a 100644 --- a/src/context.ts +++ b/src/context.ts @@ -1,10 +1,13 @@ import * as core from '@actions/core'; -import {InstallSource} from '@docker/actions-toolkit/lib/docker/install'; import {parse} from 'csv-parse/sync'; +import {InstallSource} from '@docker/actions-toolkit/lib/docker/install'; +import {Util} from '@docker/actions-toolkit/lib/util'; + export interface Inputs { source: InstallSource; daemonConfig?: string; + tcpPort?: number; context: string; setHost: boolean; rootless: boolean; @@ -21,6 +24,7 @@ export function getInputs(): Inputs { return { source: source, daemonConfig: core.getInput('daemon-config'), + tcpPort: Util.getInputNumber('tcp-port'), context: core.getInput('context'), setHost: core.getBooleanInput('set-host'), rootless: core.getBooleanInput('rootless') From 45b621d58bd96f157152c3d5c11cc8df44a4d950 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 13 Mar 2025 14:13:48 +0000 Subject: [PATCH 20/33] tcp-port opt to expose Docker API to a local TCP address --- src/main.ts | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/main.ts b/src/main.ts index 82e5c11..2c5a95e 100644 --- a/src/main.ts +++ b/src/main.ts @@ -37,12 +37,20 @@ actionsToolkit.run( throw new Error(`'default' context cannot be used.`); } + let tcpPort: number | undefined; + let tcpAddress: string | undefined; + if (input.tcpPort) { + tcpPort = input.tcpPort; + tcpAddress = `tcp://127.0.0.1:${tcpPort}`; + } + const install = new Install({ runDir: runDir, source: input.source, rootless: input.rootless, contextName: input.context || 'setup-docker-action', - daemonConfig: input.daemonConfig + daemonConfig: input.daemonConfig, + localTCPPort: tcpPort }); let toolDir; if (!(await Docker.isAvailable()) || input.source) { @@ -56,6 +64,10 @@ actionsToolkit.run( await core.group(`Setting outputs`, async () => { core.info(`sock=${sockPath}`); core.setOutput('sock', sockPath); + if (tcpAddress) { + core.info(`tcp=${tcpAddress}`); + core.setOutput('tcp', tcpAddress); + } }); if (input.setHost) { From c16a4b8efd5d5bd0d0c2136dfc4db94319e4a40e Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 13 Mar 2025 14:13:52 +0000 Subject: [PATCH 21/33] docs: Document `version` csv format MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Paweł Gronowski --- README.md | 71 +++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 69 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 264df07..94f7208 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,7 @@ ___ * [Define custom `limactl start` arguments (macOS)](#define-custom-limactl-start-arguments-macos) * [Customizing](#customizing) * [inputs](#inputs) + * [inputs.version](#inputsversion) * [outputs](#outputs) * [Contributing](#contributing) * [License](#license) @@ -113,14 +114,80 @@ The following inputs can be used as `step.with` keys | Name | Type | Default | Description | |-----------------|--------|-----------------------|-----------------------------------------------------------------------------------------------------------------------------| -| `version` | String | `latest` | Docker CE version (e.g., `v24.0.6`). | -| `channel` | String | `stable` | Docker CE [channel](https://download.docker.com/linux/static/) (e.g, `stable`, `edge` or `test`). | +| `version` | String | `latest` | Docker version to use. See [inputs.version](#inputs.version). | +| `channel` | String | `stable` | Docker CE [channel](https://download.docker.com/linux/static/) (`stable` or `test`). Only applicable to `type=archive` | | `daemon-config` | String | | [Docker daemon JSON configuration](https://docs.docker.com/engine/reference/commandline/dockerd/#daemon-configuration-file) | | `tcp-port` | Number | | TCP port to expose the Docker API locally | | `context` | String | `setup-docker-action` | Docker context name. | | `set-host` | Bool | `false` | Set `DOCKER_HOST` environment variable to docker socket path. | | `rootless` | Bool | `false` | Start daemon in rootless mode | +### inputs.version + +By default, the latest stable version of Docker is fetched from download.docker.com. + +You can specify a specific version number (e.g. `v27.4.0`). +Which is a shorthand for the full comma separated value: + +`type=archive,channel=stable,version=v27.4.0` + +You can also use this full csv format instead. + +Currently supported source types are: +- `archive` +- `image` + +#### `type=archive` +| Key | Default | Description | +|-----------|------------|--------------------------------------------------------------------------------------| +| `type` | `archive` | The source type of the Docker binaries. Possible values are `archive` and `image`. | +| `channel` | `stable` | The download.docker.com channel (`stable` or `test`). | +| `version` | `latest` | The Docker version to use. | + +Examples: +```yaml +# last stable released version +version: latest +version: type=archive # same as above +version: version=latest # same as above +version: type=archive,version=latest # same as above +``` + +```yaml +# v27.3.0-rc.1 from test channel +version: type=archive,version=27.3.0-rc.1,channel=test +``` + +#### `type=image` + +Other possible source type is `image` which will pull the Docker binaries from the `moby/moby-bin` and +`dockereng/cli-bin` Docker Hub repositories. +The advantage of using this source type is that these images are built by the Moby and Docker CI pipelines +for each branch and PR, so you can use the `tag` input to install a specific version or branch (e.g. `master`). + +| Key | Default | Description | +|-----------|------------|--------------------------------------------------------------------------------------| +| `tag` | `latest` | The image tag to use. | + +See https://hub.docker.com/r/moby/moby-bin/tags and https://hub.docker.com/r/dockereng/cli-bin/tags for available tags. + +Examples: +```yaml +# install last stable released version from bin images +version: type=image +version: type=image,tag=latest # same as above +``` + +```yaml +# a cutting-edge version from the `master` branch +version: type=image,tag=master +``` + +```yaml +# install v27.4.0 from bin images +version: type=image,tag=27.4.0 +``` + ### outputs The following outputs are available From ee766328b3e0686355f7332f3938da7d45e7c23b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 13 Mar 2025 14:13:55 +0000 Subject: [PATCH 22/33] update bake-action to v6 --- docker-bake.hcl | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docker-bake.hcl b/docker-bake.hcl index 2942972..3d72178 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -1,3 +1,9 @@ +target "_common" { + args = { + BUILDKIT_CONTEXT_KEEP_GIT_DIR = 1 + } +} + group "default" { targets = ["build"] } @@ -11,42 +17,49 @@ group "validate" { } target "build" { + inherits = ["_common"] dockerfile = "dev.Dockerfile" target = "build-update" output = ["."] } target "build-validate" { + inherits = ["_common"] dockerfile = "dev.Dockerfile" target = "build-validate" output = ["type=cacheonly"] } target "format" { + inherits = ["_common"] dockerfile = "dev.Dockerfile" target = "format-update" output = ["."] } target "lint" { + inherits = ["_common"] dockerfile = "dev.Dockerfile" target = "lint" output = ["type=cacheonly"] } target "vendor-update" { + inherits = ["_common"] dockerfile = "dev.Dockerfile" target = "vendor-update" output = ["."] } target "vendor-validate" { + inherits = ["_common"] dockerfile = "dev.Dockerfile" target = "vendor-validate" output = ["type=cacheonly"] } target "test" { + inherits = ["_common"] dockerfile = "dev.Dockerfile" target = "test-coverage" output = ["./coverage"] From 99b3c791cd096931016df773462743a772c47cdd Mon Sep 17 00:00:00 2001 From: Raj-StepSecurity Date: Fri, 4 Oct 2024 14:52:34 +0200 Subject: [PATCH 23/33] ci: enforce QEMU version on macOS --- .github/workflows/ci.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8f611a5..aac0d16 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -43,6 +43,11 @@ jobs: - name: Checkout uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + - + # https://github.com/crazy-max/ghaction-setup-docker/issues/108 + name: Set up QEMU + if: startsWith(matrix.os, 'macos') + uses: docker/actions-toolkit/.github/actions/macos-setup-qemu@19ca9ade20f5da695f76a10988d6532058575f82 - name: Set version shell: bash @@ -78,6 +83,11 @@ jobs: - name: Checkout uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + - + # https://github.com/crazy-max/ghaction-setup-docker/issues/108 + name: Set up QEMU + if: startsWith(matrix.os, 'macos') + uses: docker/actions-toolkit/.github/actions/macos-setup-qemu@19ca9ade20f5da695f76a10988d6532058575f82 - name: Set up Docker uses: ./ @@ -107,6 +117,11 @@ jobs: - name: Checkout uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + - + # https://github.com/crazy-max/ghaction-setup-docker/issues/108 + name: Set up QEMU + if: startsWith(matrix.os, 'macos') + uses: docker/actions-toolkit/.github/actions/macos-setup-qemu@19ca9ade20f5da695f76a10988d6532058575f82 - name: Set up Docker uses: ./ @@ -142,6 +157,11 @@ jobs: - name: Checkout uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + - + # https://github.com/crazy-max/ghaction-setup-docker/issues/108 + name: Set up QEMU + if: startsWith(matrix.os, 'macos') + uses: docker/actions-toolkit/.github/actions/macos-setup-qemu@19ca9ade20f5da695f76a10988d6532058575f82 - name: Set up Docker uses: ./ @@ -169,6 +189,10 @@ jobs: - name: Checkout uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + - + # https://github.com/crazy-max/ghaction-setup-docker/issues/108 + name: Set up QEMU + uses: docker/actions-toolkit/.github/actions/macos-setup-qemu@19ca9ade20f5da695f76a10988d6532058575f82 - name: Set up Docker uses: ./ @@ -246,6 +270,11 @@ jobs: - name: Checkout uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + - + # https://github.com/crazy-max/ghaction-setup-docker/issues/108 + name: Set up QEMU + if: startsWith(matrix.os, 'macos') + uses: docker/actions-toolkit/.github/actions/macos-setup-qemu@19ca9ade20f5da695f76a10988d6532058575f82 - name: Set up Docker uses: ./ From be5dec737636a20168a266bfddd647e6a16473d8 Mon Sep 17 00:00:00 2001 From: Raj-StepSecurity Date: Tue, 29 Oct 2024 22:28:27 +0100 Subject: [PATCH 24/33] ci: matrix entry for image type --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index aac0d16..a5fbd4a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,6 +31,7 @@ jobs: version: - pinned - latest + - type=image,tag=27.3.1 include: - os: macos-13 version: pinned From 40ad150d295ad132ca2781b950e11dd4c57ce90f Mon Sep 17 00:00:00 2001 From: Raj-StepSecurity Date: Thu, 14 Nov 2024 14:26:25 +0100 Subject: [PATCH 25/33] ci: rootless job --- .github/workflows/ci.yml | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a5fbd4a..8c2160a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -358,7 +358,19 @@ jobs: name: List contexts run: | docker context ls + + rootless: + runs-on: ubuntu-latest + steps: - - name: Dump context - if: always() - uses: crazy-max/ghaction-dump-context@5355a8e5e6ac5a302e746a1c4b7747a0393863c8 # v2.3.0 + name: Checkout + uses: actions/checkout@v4 + - + name: Set up Docker + uses: ./ + with: + rootless: true + - + name: List contexts + run: | + docker context ls From 7727a71445650d7039dbb1cea451f75507763b9f Mon Sep 17 00:00:00 2001 From: Raj-StepSecurity Date: Tue, 19 Nov 2024 00:54:28 +0100 Subject: [PATCH 26/33] ci: fix deprecated input for codecov-action --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index cef8ead..0c3cbba 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -32,5 +32,5 @@ jobs: name: Upload coverage uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # v4.5.0 with: - file: ./coverage/clover.xml + files: ./coverage/clover.xml token: ${{ secrets.CODECOV_TOKEN }} From 9d440e6523c729c7e5e369f79d6db9b5d1c9792a Mon Sep 17 00:00:00 2001 From: Raj-StepSecurity Date: Mon, 25 Nov 2024 14:58:38 +0100 Subject: [PATCH 27/33] ci: remove qemu set up workaround --- .github/workflows/ci.yml | 29 ----------------------------- 1 file changed, 29 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8c2160a..ac6421f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,11 +44,6 @@ jobs: - name: Checkout uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - - - # https://github.com/crazy-max/ghaction-setup-docker/issues/108 - name: Set up QEMU - if: startsWith(matrix.os, 'macos') - uses: docker/actions-toolkit/.github/actions/macos-setup-qemu@19ca9ade20f5da695f76a10988d6532058575f82 - name: Set version shell: bash @@ -84,11 +79,6 @@ jobs: - name: Checkout uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - - - # https://github.com/crazy-max/ghaction-setup-docker/issues/108 - name: Set up QEMU - if: startsWith(matrix.os, 'macos') - uses: docker/actions-toolkit/.github/actions/macos-setup-qemu@19ca9ade20f5da695f76a10988d6532058575f82 - name: Set up Docker uses: ./ @@ -118,11 +108,6 @@ jobs: - name: Checkout uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - - - # https://github.com/crazy-max/ghaction-setup-docker/issues/108 - name: Set up QEMU - if: startsWith(matrix.os, 'macos') - uses: docker/actions-toolkit/.github/actions/macos-setup-qemu@19ca9ade20f5da695f76a10988d6532058575f82 - name: Set up Docker uses: ./ @@ -158,11 +143,6 @@ jobs: - name: Checkout uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - - - # https://github.com/crazy-max/ghaction-setup-docker/issues/108 - name: Set up QEMU - if: startsWith(matrix.os, 'macos') - uses: docker/actions-toolkit/.github/actions/macos-setup-qemu@19ca9ade20f5da695f76a10988d6532058575f82 - name: Set up Docker uses: ./ @@ -190,10 +170,6 @@ jobs: - name: Checkout uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - - - # https://github.com/crazy-max/ghaction-setup-docker/issues/108 - name: Set up QEMU - uses: docker/actions-toolkit/.github/actions/macos-setup-qemu@19ca9ade20f5da695f76a10988d6532058575f82 - name: Set up Docker uses: ./ @@ -271,11 +247,6 @@ jobs: - name: Checkout uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - - - # https://github.com/crazy-max/ghaction-setup-docker/issues/108 - name: Set up QEMU - if: startsWith(matrix.os, 'macos') - uses: docker/actions-toolkit/.github/actions/macos-setup-qemu@19ca9ade20f5da695f76a10988d6532058575f82 - name: Set up Docker uses: ./ From 5c98d6bfce2b7fc5ce730fc3ef29180c930d916c Mon Sep 17 00:00:00 2001 From: Raj-StepSecurity Date: Mon, 25 Nov 2024 15:14:11 +0100 Subject: [PATCH 28/33] ci: bump docker version --- .github/workflows/ci.yml | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ac6421f..24ba538 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,7 +17,7 @@ on: pull_request: env: - DOCKER_VERSION: v24.0.9 + DOCKER_VERSION: v27.3.1 jobs: main: @@ -29,8 +29,7 @@ jobs: - ubuntu-latest - windows-latest version: - - pinned - - latest + - v27.3.1 - type=image,tag=27.3.1 include: - os: macos-13 @@ -44,22 +43,11 @@ jobs: - name: Checkout uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - - - name: Set version - shell: bash - run: | - if [ "${{ matrix.version }}" != "pinned" ]; then - echo "DOCKER_VERSION=${{ matrix.version }}" >> $GITHUB_ENV - fi - name: Set up Docker uses: ./ with: - version: ${{ env.DOCKER_VERSION }} - - - name: Dump context - if: always() - uses: crazy-max/ghaction-dump-context@5355a8e5e6ac5a302e746a1c4b7747a0393863c8 # v2.3.0 + version: ${{ matrix.version }} channel: runs-on: ${{ matrix.os }} @@ -83,7 +71,7 @@ jobs: name: Set up Docker uses: ./ with: - version: v24.0.0-rc.4 + version: ${{ env.DOCKER_VERSION }} channel: test - name: Dump context @@ -112,6 +100,7 @@ jobs: name: Set up Docker uses: ./ with: + version: ${{ env.DOCKER_VERSION }} daemon-config: | { "debug": true, @@ -173,6 +162,8 @@ jobs: - name: Set up Docker uses: ./ + with: + version: ${{ env.DOCKER_VERSION }} env: LIMA_START_ARGS: --cpus 4 --memory 8 @@ -324,6 +315,7 @@ jobs: name: Set up Docker uses: ./ with: + version: ${{ env.DOCKER_VERSION }} set-host: true - name: List contexts @@ -340,6 +332,7 @@ jobs: name: Set up Docker uses: ./ with: + version: ${{ env.DOCKER_VERSION }} rootless: true - name: List contexts From a0cfab83a972dceaf38a001bfdc30a5d53ed1ac0 Mon Sep 17 00:00:00 2001 From: Raj-StepSecurity Date: Wed, 13 Sep 2023 09:15:19 +0200 Subject: [PATCH 29/33] chore: migrate to docker org --- action.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/action.yml b/action.yml index b618556..f9ccd9a 100644 --- a/action.yml +++ b/action.yml @@ -1,6 +1,7 @@ # https://help.github.com/en/articles/metadata-syntax-for-github-actions -name: 'Docker Setup Docker' -description: 'Set up Docker for use in GitHub Actions by downloading and installing a version of Docker CE' +name: Docker Setup Docker +description: Set up Docker for use in GitHub Actions by downloading and installing a version of Docker CE +author: step-security branding: icon: 'anchor' color: 'blue' From a0fc18fa7922492d78ef268bc24903483857c146 Mon Sep 17 00:00:00 2001 From: Raj-StepSecurity Date: Fri, 6 Dec 2024 14:52:34 +0100 Subject: [PATCH 30/33] ci: disable build summary --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 24ba538..bd1f9e1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,6 +18,7 @@ on: env: DOCKER_VERSION: v27.3.1 + DOCKER_BUILD_SUMMARY: false jobs: main: From 9263acb7896401a843ffbe648319287e55c22343 Mon Sep 17 00:00:00 2001 From: Raj-StepSecurity Date: Thu, 20 Mar 2025 13:06:02 +0530 Subject: [PATCH 31/33] tcp-port opt to expose Docker API to a local TCP address --- .github/SUPPORT.md | 31 ------------------------------- .github/workflows/ci.yml | 28 ++++++++++++++++++++++++++++ README.md | 6 +++--- 3 files changed, 31 insertions(+), 34 deletions(-) delete mode 100644 .github/SUPPORT.md diff --git a/.github/SUPPORT.md b/.github/SUPPORT.md deleted file mode 100644 index 24fa7ca..0000000 --- a/.github/SUPPORT.md +++ /dev/null @@ -1,31 +0,0 @@ -# Support [![](https://isitmaintained.com/badge/resolution/step-security/ghaction-setup-docker.svg)](https://isitmaintained.com/project/step-security/ghaction-setup-docker) - -First, [be a good guy](https://github.com/kossnocorp/etiquette/blob/master/README.md). - -## Reporting an issue - -Please do a search in [open issues](https://github.com/step-security/ghaction-setup-docker/issues?utf8=%E2%9C%93&q=) to see if the issue or feature request has already been filed. - -If you find your issue already exists, make relevant comments and add your [reaction](https://github.com/blog/2119-add-reactions-to-pull-requests-issues-and-comments). Use a reaction in place of a "+1" comment. - -:+1: - upvote - -:-1: - downvote - -If you cannot find an existing issue that describes your bug or feature, submit an issue using the guidelines below. - -## Writing good bug reports and feature requests - -File a single issue per problem and feature request. - -* Do not enumerate multiple bugs or feature requests in the same issue. -* Do not add your issue as a comment to an existing issue unless it's for the identical input. Many issues look similar, but have different causes. - -The more information you can provide, the more likely someone will be successful reproducing the issue and finding a fix. - -You are now ready to [create a new issue](https://github.com/step-security/ghaction-setup-docker/issues/new/choose)! - -## Closure policy - -* Issues that don't have the information requested above (when applicable) will be closed immediately and the poster directed to the support guidelines. -* Issues that go a week without a response from original poster are subject to closure at our discretion. diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bd1f9e1..fadc2fd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -339,3 +339,31 @@ jobs: name: List contexts run: | docker context ls + + tcp: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: + - ubuntu-latest + #- macos-14 # no virt: https://github.com/docker/actions-toolkit/issues/317 + - macos-13 + - windows-latest + steps: + - + name: Checkout + uses: actions/checkout@v4 + - + name: Set up Docker + id: setup_docker + uses: ./ + with: + version: ${{ env.DOCKER_VERSION }} + tcp-port: 2378 + - + name: Check docker info through TCP + run: | + docker info + env: + DOCKER_HOST: ${{ steps.setup_docker.outputs.tcp }} \ No newline at end of file diff --git a/README.md b/README.md index 94f7208..08ffbed 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,7 @@ jobs: steps: - name: Set up Docker - uses: step-security/ghaction-setup-docker@v3 + uses: step-security/ghaction-setup-docker@4 ``` ### Daemon configuration @@ -73,7 +73,7 @@ jobs: steps: - name: Set up Docker - uses: step-security/ghaction-setup-docker@v3 + uses: step-security/ghaction-setup-docker@4 with: daemon-config: | { @@ -101,7 +101,7 @@ jobs: steps: - name: Set up Docker - uses: step-security/ghaction-setup-docker@v3 + uses: step-security/ghaction-setup-docker@4 env: LIMA_START_ARGS: --cpus 4 --memory 8 ``` From 5098ade231b0564fe3540f9d7890c33b8885b309 Mon Sep 17 00:00:00 2001 From: Raj-StepSecurity Date: Wed, 8 Jan 2025 13:04:17 +0100 Subject: [PATCH 32/33] update bake-action to v6 --- .github/workflows/test.yml | 5 +---- .github/workflows/validate.yml | 16 +++++++--------- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0c3cbba..cb8f173 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -20,12 +20,9 @@ jobs: with: egress-policy: audit - - - name: Checkout - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - name: Test - uses: docker/bake-action@f6acc70fe0da9b200315017ca49a08c0de03aa0b # v5.1.0 + uses: docker/bake-action@v6 with: targets: test - diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 7cb829d..226acf6 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -15,7 +15,7 @@ jobs: prepare: runs-on: ubuntu-latest outputs: - targets: ${{ steps.targets.outputs.matrix }} + targets: ${{ steps.generate.outputs.targets }} steps: - name: Harden Runner uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1 @@ -26,10 +26,11 @@ jobs: name: Checkout uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - - name: Targets matrix - id: targets - run: | - echo "matrix=$(docker buildx bake validate --print | jq -cr '.group.validate.targets')" >> $GITHUB_OUTPUT + name: List targets + id: generate + uses: docker/bake-action/subaction/list-targets@v6 + with: + target: validate validate: runs-on: ubuntu-latest @@ -45,11 +46,8 @@ jobs: with: egress-policy: audit - - - name: Checkout - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - name: Validate - uses: docker/bake-action@f6acc70fe0da9b200315017ca49a08c0de03aa0b # v5.1.0 + uses: docker/bake-action@v6 with: targets: ${{ matrix.target }} From f55ac638ec4ebb7e969411a30495e2597e3e3ecc Mon Sep 17 00:00:00 2001 From: Raj-StepSecurity Date: Tue, 28 Jan 2025 10:40:04 +0100 Subject: [PATCH 33/33] ci: test ubuntu arm64 runners --- .github/workflows/ci.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fadc2fd..3d6687a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,6 +28,8 @@ jobs: matrix: os: - ubuntu-latest + - ubuntu-24.04-arm + #- macos-14 # no virt: https://github.com/docker/actions-toolkit/issues/317 - windows-latest version: - v27.3.1 @@ -57,6 +59,7 @@ jobs: matrix: os: - ubuntu-latest + - ubuntu-24.04-arm #- macos-14 # no virt: https://github.com/docker/actions-toolkit/issues/317 - windows-latest steps: @@ -86,6 +89,7 @@ jobs: matrix: os: - ubuntu-latest + - ubuntu-24.04-arm #- macos-14 # no virt: https://github.com/docker/actions-toolkit/issues/317 - windows-latest steps: @@ -121,6 +125,7 @@ jobs: matrix: os: - ubuntu-latest + - ubuntu-24.04-arm #- macos-14 # no virt: https://github.com/docker/actions-toolkit/issues/317 - macos-13 - windows-latest @@ -347,6 +352,7 @@ jobs: matrix: os: - ubuntu-latest + - ubuntu-24.04-arm #- macos-14 # no virt: https://github.com/docker/actions-toolkit/issues/317 - macos-13 - windows-latest