43 Commits

Author SHA1 Message Date
01efb57f88 Merge pull request #133 from docker/dependabot/npm_and_yarn/docker/actions-toolkit-0.47.0
build(deps): bump @docker/actions-toolkit from 0.46.0 to 0.47.0
2024-12-06 14:28:29 +01:00
f5dddcbf38 build(deps): bump @docker/actions-toolkit from 0.46.0 to 0.47.0
Bumps [@docker/actions-toolkit](https://github.com/docker/actions-toolkit) from 0.46.0 to 0.47.0.
- [Release notes](https://github.com/docker/actions-toolkit/releases)
- [Commits](https://github.com/docker/actions-toolkit/compare/v0.46.0...v0.47.0)

---
updated-dependencies:
- dependency-name: "@docker/actions-toolkit"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-06 13:23:58 +00:00
ccdfecaaf2 Merge pull request #40 from docker/migrate
chore: migrate to docker org
2024-12-06 12:59:04 +01:00
07f0e609c6 docs: note about action usage 2024-11-26 10:05:12 +01:00
eff8d999dc chore: github form templates 2024-11-26 10:05:12 +01:00
57e629a437 chore: update community files 2024-11-26 10:05:11 +01:00
5bf030df68 chore: migrate to docker org 2024-11-26 10:05:02 +01:00
635d07c09d Merge pull request #119 from crazy-max/update-readme
readme: remove qemu set up workaround
2024-11-25 16:43:21 +01:00
34a3d15d63 readme: remove qemu set up workaround 2024-11-25 16:34:05 +01:00
560d8b137b Merge pull request #132 from crazy-max/dependabot/npm_and_yarn/docker/actions-toolkit-0.46.0
build(deps): bump @docker/actions-toolkit from 0.45.0 to 0.46.0
2024-11-25 16:33:22 +01:00
482b1d74c1 ci: bump docker version 2024-11-25 15:54:25 +01:00
f0ff59fe55 ci: remove qemu set up workaround 2024-11-25 14:58:38 +01:00
939fbc5e6e chore: update generated content 2024-11-25 14:10:51 +01:00
a0bafae0b8 build(deps): bump @docker/actions-toolkit from 0.45.0 to 0.46.0
Bumps [@docker/actions-toolkit](https://github.com/docker/actions-toolkit) from 0.45.0 to 0.46.0.
- [Release notes](https://github.com/docker/actions-toolkit/releases)
- [Commits](https://github.com/docker/actions-toolkit/compare/v0.45.0...v0.46.0)

---
updated-dependencies:
- dependency-name: "@docker/actions-toolkit"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-25 13:07:41 +00:00
a37e5b7d61 Merge pull request #130 from crazy-max/dependabot/npm_and_yarn/cross-spawn-7.0.6
build(deps): bump cross-spawn from 7.0.3 to 7.0.6
2024-11-19 02:37:07 +01:00
f6d883591e Merge pull request #129 from crazy-max/dependabot/npm_and_yarn/docker/actions-toolkit-0.45.0
build(deps): bump @docker/actions-toolkit from 0.44.0 to 0.45.0
2024-11-19 02:36:02 +01:00
02c50bf68d Merge pull request #127 from crazy-max/dependabot/github_actions/codecov/codecov-action-5
build(deps): bump codecov/codecov-action from 4 to 5
2024-11-19 01:35:51 +01:00
6ec0bb821a chore: update generated content 2024-11-19 01:06:46 +01:00
3b54d1cfdf build(deps): bump cross-spawn from 7.0.3 to 7.0.6
Bumps [cross-spawn](https://github.com/moxystudio/node-cross-spawn) from 7.0.3 to 7.0.6.
- [Changelog](https://github.com/moxystudio/node-cross-spawn/blob/master/CHANGELOG.md)
- [Commits](https://github.com/moxystudio/node-cross-spawn/compare/v7.0.3...v7.0.6)

---
updated-dependencies:
- dependency-name: cross-spawn
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-18 23:57:08 +00:00
eaea3291c9 build(deps): bump @docker/actions-toolkit from 0.44.0 to 0.45.0
Bumps [@docker/actions-toolkit](https://github.com/docker/actions-toolkit) from 0.44.0 to 0.45.0.
- [Release notes](https://github.com/docker/actions-toolkit/releases)
- [Commits](https://github.com/docker/actions-toolkit/compare/v0.44.0...v0.45.0)

---
updated-dependencies:
- dependency-name: "@docker/actions-toolkit"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-18 23:56:30 +00:00
8b555caf8d Merge pull request #128 from crazy-max/drop-macos-12
ci: remove deprecated macos-12 runner
2024-11-19 00:55:15 +01:00
40162ae1f1 ci: fix deprecated input for codecov-action 2024-11-19 00:54:28 +01:00
7d1184f528 ci: remove deprecated macos-12 runner 2024-11-19 00:51:08 +01:00
2419f2cbba build(deps): bump codecov/codecov-action from 4 to 5
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 4 to 5.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-action/compare/v4...v5)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-15 10:18:31 +00:00
332d315257 Merge pull request #124 from vvoland/rootless
Add rootless support
2024-11-14 15:18:28 +01:00
343f86705e ci: rootless job 2024-11-14 14:26:25 +01:00
bcd97be19b Add rootless support
Wire up `rootless` config to the new `rootless` Install option.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2024-11-14 14:21:34 +01:00
e02739be38 Merge pull request #126 from crazy-max/dependabot/npm_and_yarn/docker/actions-toolkit-0.44.0
build(deps): bump @docker/actions-toolkit from 0.43.0 to 0.44.0
2024-11-13 14:50:46 +01:00
0d3aa44c5c chore: update generated content 2024-11-13 14:17:39 +01:00
a508bb356e build(deps): bump @docker/actions-toolkit from 0.43.0 to 0.44.0
Bumps [@docker/actions-toolkit](https://github.com/docker/actions-toolkit) from 0.43.0 to 0.44.0.
- [Release notes](https://github.com/docker/actions-toolkit/releases)
- [Commits](https://github.com/docker/actions-toolkit/compare/v0.43.0...v0.44.0)

---
updated-dependencies:
- dependency-name: "@docker/actions-toolkit"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-13 12:44:58 +00:00
3e94cecda0 Merge pull request #125 from crazy-max/dependabot/npm_and_yarn/docker/actions-toolkit-0.43.0
build(deps): bump @docker/actions-toolkit from 0.42.0 to 0.43.0
2024-11-07 17:25:03 +01:00
701f172a16 chore: update generated content 2024-11-07 17:03:18 +01:00
90aad53e72 build(deps): bump @docker/actions-toolkit from 0.42.0 to 0.43.0
Bumps [@docker/actions-toolkit](https://github.com/docker/actions-toolkit) from 0.42.0 to 0.43.0.
- [Release notes](https://github.com/docker/actions-toolkit/releases)
- [Commits](https://github.com/docker/actions-toolkit/compare/v0.42.0...v0.43.0)

---
updated-dependencies:
- dependency-name: "@docker/actions-toolkit"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-07 16:01:40 +00:00
a9ddd812ce Merge pull request #123 from crazy-max/dependabot/npm_and_yarn/docker/actions-toolkit-0.42.0
build(deps): bump @docker/actions-toolkit from 0.41.1 to 0.42.0
2024-11-05 16:45:43 +01:00
91cbfc7996 chore: update generated content 2024-10-30 16:30:03 +01:00
7de04ecfd0 build(deps): bump @docker/actions-toolkit from 0.41.1 to 0.42.0
Bumps [@docker/actions-toolkit](https://github.com/docker/actions-toolkit) from 0.41.1 to 0.42.0.
- [Release notes](https://github.com/docker/actions-toolkit/releases)
- [Commits](https://github.com/docker/actions-toolkit/compare/v0.41.1...v0.42.0)

---
updated-dependencies:
- dependency-name: "@docker/actions-toolkit"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-10-30 15:28:37 +00:00
8321f1dc18 Merge pull request #106 from vvoland/binimg
support downloading binaries from docker images
2024-10-30 12:40:04 +01:00
ff9a36b06e ci: matrix entry for image type 2024-10-30 11:26:50 +01:00
cd5049af64 Support downloading binaries from docker images
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2024-10-29 17:36:32 +01:00
810b53a8ba Merge pull request #122 from crazy-max/dependabot/npm_and_yarn/docker/actions-toolkit-0.41.1
build(deps): bump @docker/actions-toolkit from 0.40.0 to 0.41.1
2024-10-29 16:45:00 +01:00
ba5a8c50ed chore: update generated content 2024-10-29 16:29:19 +01:00
8677037d08 changed signature for install method 2024-10-29 16:27:21 +01:00
ff2661333b build(deps): bump @docker/actions-toolkit from 0.40.0 to 0.41.1
Bumps [@docker/actions-toolkit](https://github.com/docker/actions-toolkit) from 0.40.0 to 0.41.1.
- [Release notes](https://github.com/docker/actions-toolkit/releases)
- [Commits](https://github.com/docker/actions-toolkit/compare/v0.40.0...v0.41.1)

---
updated-dependencies:
- dependency-name: "@docker/actions-toolkit"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-10-29 15:26:43 +00:00
20 changed files with 445 additions and 231 deletions

1
.github/CODEOWNERS vendored
View File

@ -1 +0,0 @@
* @crazy-max

3
.github/CODE_OF_CONDUCT.md vendored Normal file
View File

@ -0,0 +1,3 @@
# Code of conduct
- [Moby community guidelines](https://github.com/moby/moby/blob/master/CONTRIBUTING.md#moby-community-guidelines)

View File

@ -7,13 +7,13 @@ to the public under the [project's open source license](LICENSE).
## Submitting a pull request
1. [Fork](https://github.com/crazy-max/ghaction-setup-docker/fork) and clone the repository
1. [Fork](https://github.com/docker/setup-docker-action/fork) and clone the repository
2. Configure and install the dependencies: `yarn install`
3. Create a new branch: `git checkout -b my-branch-name`
4. Make your changes
5. Format code and build javascript artifacts: `docker buildx bake pre-checkin`
6. Validate all code has correctly formatted and built: `docker buildx bake validate`
7. Push to your fork and [submit a pull request](https://github.com/crazy-max/ghaction-setup-docker/compare)
7. Push to your fork and [submit a pull request](https://github.com/docker/setup-docker-action/compare)
8. Pat your self on the back and wait for your pull request to be reviewed and merged.
Here are a few things you can do that will increase the likelihood of your pull request being accepted:

102
.github/ISSUE_TEMPLATE/bug.yml vendored Normal file
View File

@ -0,0 +1,102 @@
# https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema
name: Bug Report
description: Report a bug
labels:
- status/triage
body:
- type: markdown
attributes:
value: |
Thank you for taking the time to report a bug!
If this is a security issue please report it to the [Docker Security team](mailto:security@docker.com).
Before submitting a bug report, check out the [Troubleshooting doc](https://github.com/docker/setup-docker-action/blob/master/TROUBLESHOOTING.md).
- type: checkboxes
attributes:
label: Contributing guidelines
description: >
Make sure you've read the contributing guidelines before proceeding.
options:
- label: I've read the [contributing guidelines](https://github.com/docker/setup-docker-action/blob/master/.github/CONTRIBUTING.md) and wholeheartedly agree
required: true
- type: checkboxes
attributes:
label: "I've found a bug, and:"
description: |
Make sure that your request fulfills all of the following requirements.
If one requirement cannot be satisfied, explain in detail why.
options:
- label: The documentation does not mention anything about my problem
- label: There are no open or closed issues that are related to my problem
- type: textarea
attributes:
label: Description
description: >
Provide a brief description of the bug in 1-2 sentences.
validations:
required: true
- type: textarea
attributes:
label: Expected behaviour
description: >
Describe precisely what you'd expect to happen.
validations:
required: true
- type: textarea
attributes:
label: Actual behaviour
description: >
Describe precisely what is actually happening.
validations:
required: true
- type: input
attributes:
label: Repository URL
description: >
Enter the URL of the repository where you are experiencing the
issue. If your repository is private, provide a link to a minimal
repository that reproduces the issue.
- type: input
attributes:
label: Workflow run URL
description: >
Enter the URL of the GitHub Action workflow run if public (e.g.
`https://github.com/<user>/<repo>/actions/runs/<id>`)
- type: textarea
attributes:
label: YAML workflow
description: |
Provide the YAML of the workflow that's causing the issue.
Make sure to remove any sensitive information.
render: yaml
validations:
required: true
- type: textarea
attributes:
label: Workflow logs
description: >
[Attach](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/attaching-files)
the [log file of your workflow run](https://docs.github.com/en/actions/managing-workflow-runs/using-workflow-run-logs#downloading-logs)
and make sure to remove any sensitive information.
- type: textarea
attributes:
label: Docker daemon logs
description: >
If applicable, provide the Docker logs available in post step.
render: text
- type: textarea
attributes:
label: Additional info
description: |
Provide any additional information that could be useful.

View File

@ -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.

6
.github/ISSUE_TEMPLATE/config.yml vendored Normal file
View File

@ -0,0 +1,6 @@
# https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/configuring-issue-templates-for-your-repository#configuring-the-template-chooser
blank_issues_enabled: true
contact_links:
- name: Questions and Discussions
url: https://github.com/docker/setup-docker-action/discussions/new
about: Use Github Discussions to ask questions and/or open discussion topics.

15
.github/ISSUE_TEMPLATE/feature.yml vendored Normal file
View File

@ -0,0 +1,15 @@
# https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema
name: Feature request
description: Missing functionality? Come tell us about it!
labels:
- kind/enhancement
- status/triage
body:
- type: textarea
id: description
attributes:
label: Description
description: What is the feature you want to see?
validations:
required: true

12
.github/SECURITY.md vendored Normal file
View File

@ -0,0 +1,12 @@
# Reporting security issues
The project maintainers take security seriously. If you discover a security
issue, please bring it to their attention right away!
**Please _DO NOT_ file a public issue**, instead send your report privately to
[security@docker.com](mailto:security@docker.com).
Security reports are greatly appreciated, and we will publicly thank you for it.
We also like to send gifts&mdash;if you'd like Docker swag, make sure to let
us know. We currently do not offer a paid security bounty program, but are not
ruling it out in the future.

31
.github/SUPPORT.md vendored
View File

@ -1,31 +0,0 @@
# Support [![](https://isitmaintained.com/badge/resolution/crazy-max/ghaction-setup-docker.svg)](https://isitmaintained.com/project/crazy-max/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/crazy-max/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/crazy-max/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.

View File

@ -17,7 +17,7 @@ on:
pull_request:
env:
DOCKER_VERSION: v24.0.9
DOCKER_VERSION: v27.3.1
jobs:
main:
@ -31,33 +31,17 @@ jobs:
- macos-13
- windows-latest
version:
- pinned
- latest
- v27.3.1
- type=image,tag=27.3.1
steps:
-
name: Checkout
uses: actions/checkout@v4
-
# 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
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@v2
version: ${{ matrix.version }}
channel:
runs-on: ${{ matrix.os }}
@ -73,21 +57,12 @@ jobs:
-
name: Checkout
uses: actions/checkout@v4
-
# 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: ./
with:
version: v24.0.0-rc.4
version: ${{ env.DOCKER_VERSION }}
channel: test
-
name: Dump context
if: always()
uses: crazy-max/ghaction-dump-context@v2
daemon-config:
runs-on: ${{ matrix.os }}
@ -103,15 +78,11 @@ jobs:
-
name: Checkout
uses: actions/checkout@v4
-
# 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: ./
with:
version: ${{ env.DOCKER_VERSION }}
daemon-config: |
{
"debug": true,
@ -119,10 +90,6 @@ jobs:
"containerd-snapshotter": true
}
}
-
name: Dump context
if: always()
uses: crazy-max/ghaction-dump-context@v2
context:
runs-on: ${{ matrix.os }}
@ -138,11 +105,6 @@ jobs:
-
name: Checkout
uses: actions/checkout@v4
-
# 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: ./
@ -153,10 +115,6 @@ jobs:
name: Check context
run: |
docker context inspect foo
-
name: Dump context
if: always()
uses: crazy-max/ghaction-dump-context@v2
lima-start-args:
#runs-on: macos-14 # no virt: https://github.com/docker/actions-toolkit/issues/317
@ -165,13 +123,11 @@ jobs:
-
name: Checkout
uses: actions/checkout@v4
-
# 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: ./
with:
version: ${{ env.DOCKER_VERSION }}
env:
LIMA_START_ARGS: --cpus 4 --memory 8
@ -219,10 +175,6 @@ jobs:
name: Inspect
run: |
docker buildx imagetools inspect localhost:5000/name/app:latest --format '{{json .}}'
-
name: Dump context
if: always()
uses: crazy-max/ghaction-dump-context@v2
build-macos:
runs-on: ${{ matrix.os }}
@ -232,16 +184,10 @@ jobs:
os:
#- macos-14 # no virt: https://github.com/docker/actions-toolkit/issues/317
- macos-13
- macos-12
steps:
-
name: Checkout
uses: actions/checkout@v4
-
# 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: ./
@ -269,10 +215,6 @@ jobs:
name: Inspect
run: |
docker buildx imagetools inspect localhost:5000/name/app:latest --format '{{json .}}'
-
name: Dump context
if: always()
uses: crazy-max/ghaction-dump-context@v2
build-windows:
runs-on: windows-latest
@ -294,10 +236,6 @@ jobs:
name: Inspect
run: |
docker image inspect test
-
name: Dump context
if: always()
uses: crazy-max/ghaction-dump-context@v2
set-host:
runs-on: ubuntu-latest
@ -309,12 +247,26 @@ jobs:
name: Set up Docker
uses: ./
with:
version: ${{ env.DOCKER_VERSION }}
set-host: true
-
name: List contexts
run: |
docker context ls
rootless:
runs-on: ubuntu-latest
steps:
-
name: Dump context
if: always()
uses: crazy-max/ghaction-dump-context@v2
name: Checkout
uses: actions/checkout@v4
-
name: Set up Docker
uses: ./
with:
version: ${{ env.DOCKER_VERSION }}
rootless: true
-
name: List contexts
run: |
docker context ls

View File

@ -25,7 +25,7 @@ jobs:
targets: test
-
name: Upload coverage
uses: codecov/codecov-action@v4
uses: codecov/codecov-action@v5
with:
file: ./coverage/clover.xml
files: ./coverage/clover.xml
token: ${{ secrets.CODECOV_TOKEN }}

View File

@ -1,14 +1,21 @@
[![GitHub release](https://img.shields.io/github/release/crazy-max/ghaction-setup-docker.svg?style=flat-square)](https://github.com/crazy-max/ghaction-setup-docker/releases/latest)
[![GitHub release](https://img.shields.io/github/release/docker/setup-docker-action.svg?style=flat-square)](https://github.com/docker/setup-docker-action/releases/latest)
[![GitHub marketplace](https://img.shields.io/badge/marketplace-docker--setup--docker-blue?logo=github&style=flat-square)](https://github.com/marketplace/actions/docker-setup-docker)
[![CI workflow](https://img.shields.io/github/actions/workflow/status/crazy-max/ghaction-setup-docker/ci.yml?branch=master&label=ci&logo=github&style=flat-square)](https://github.com/crazy-max/ghaction-setup-docker/actions?workflow=ci)
[![Test workflow](https://img.shields.io/github/actions/workflow/status/crazy-max/ghaction-setup-docker/test.yml?branch=master&label=test&logo=github&style=flat-square)](https://github.com/crazy-max/ghaction-setup-docker/actions?workflow=test)
[![Codecov](https://img.shields.io/codecov/c/github/crazy-max/ghaction-setup-docker?logo=codecov&style=flat-square)](https://codecov.io/gh/crazy-max/ghaction-setup-docker)
[![CI workflow](https://img.shields.io/github/actions/workflow/status/docker/setup-docker-action/ci.yml?branch=master&label=ci&logo=github&style=flat-square)](https://github.com/docker/setup-docker-action/actions?workflow=ci)
[![Test workflow](https://img.shields.io/github/actions/workflow/status/docker/setup-docker-action/test.yml?branch=master&label=test&logo=github&style=flat-square)](https://github.com/docker/setup-docker-action/actions?workflow=test)
[![Codecov](https://img.shields.io/codecov/c/github/docker/setup-docker-action?logo=codecov&style=flat-square)](https://codecov.io/gh/docker/setup-docker-action)
## About
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/crazy-max/ghaction-setup-docker/pull/53
@ -44,32 +51,9 @@ jobs:
steps:
-
name: Set up Docker
uses: crazy-max/ghaction-setup-docker@v3
uses: docker/setup-docker-action@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)
@ -89,7 +73,7 @@ jobs:
steps:
-
name: Set up Docker
uses: crazy-max/ghaction-setup-docker@v3
uses: docker/setup-docker-action@v3
with:
daemon-config: |
{
@ -117,7 +101,7 @@ jobs:
steps:
-
name: Set up Docker
uses: crazy-max/ghaction-setup-docker@v3
uses: docker/setup-docker-action@v3
env:
LIMA_START_ARGS: --cpus 4 --memory 8
```
@ -135,6 +119,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
@ -146,12 +131,8 @@ The following outputs are available
## Contributing
Want to contribute? Awesome! The most basic way to show your support is to star
the project, or to raise issues. You can also support this project by [**becoming a sponsor on GitHub**](https://github.com/sponsors/crazy-max)
or by making a [PayPal donation](https://www.paypal.me/crazyws) to ensure this
journey continues indefinitely!
Thanks again for your support, it is much appreciated! :pray:
Want to contribute? Awesome! You can find information about contributing to
this project in the [CONTRIBUTING.md](/.github/CONTRIBUTING.md)
## License

View File

@ -19,12 +19,17 @@ describe('getInputs', () => {
new Map<string, string>([
['version', 'v24.0.8'],
['set-host', 'false'],
['rootless', 'false'],
]),
{
version: 'v24.0.8',
channel: '',
source: {
type: 'archive',
version: 'v24.0.8',
channel: 'stable'
},
context: '',
daemonConfig: '',
rootless: false,
setHost: false
} as context.Inputs
],
@ -36,12 +41,17 @@ describe('getInputs', () => {
['context', 'foo'],
['daemon-config', `{"debug":true,"features":{"containerd-snapshotter":true}}`],
['set-host', 'false'],
['rootless', '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}}`,
rootless: false,
setHost: false
} as context.Inputs
],
@ -49,15 +59,132 @@ describe('getInputs', () => {
2,
new Map<string, string>([
['set-host', 'true'],
['rootless', 'false'],
]),
{
version: 'latest',
channel: '',
source: {
type: 'archive',
version: 'latest',
channel: 'stable',
},
context: '',
daemonConfig: '',
rootless: false,
setHost: true
} as context.Inputs
]
],
[
3,
new Map<string, string>([
['version', 'type=image,tag=master'],
['context', 'foo'],
['daemon-config', `{"debug":true,"features":{"containerd-snapshotter":true}}`],
['set-host', 'false'],
['rootless', 'false'],
]),
{
source: {
type: 'image',
tag: 'master',
},
context: 'foo',
daemonConfig: `{"debug":true,"features":{"containerd-snapshotter":true}}`,
rootless: false,
setHost: false
} as context.Inputs
],
[
4,
new Map<string, string>([
['version', 'type=image'],
['set-host', 'false'],
['rootless', 'false'],
]),
{
source: {
type: 'image',
tag: 'latest',
},
context: '',
daemonConfig: '',
rootless: false,
setHost: false
} as context.Inputs
],
[
5,
new Map<string, string>([
['version', 'type=archive'],
['set-host', 'false'],
['rootless', 'false'],
]),
{
source: {
type: 'archive',
version: 'latest',
channel: 'stable',
},
setHost: false,
context: '',
daemonConfig: '',
rootless: false,
} as context.Inputs
],
[
6,
new Map<string, string>([
['version', 'version=v27.2.0,channel=test'],
['set-host', 'false'],
['rootless', 'false'],
]),
{
source: {
type: 'archive',
version: 'v27.2.0',
channel: 'test',
},
setHost: false,
context: '',
daemonConfig: '',
rootless: false,
} as context.Inputs
],
[
7,
new Map<string, string>([
['version', 'type=image,tag=27.2.1'],
['set-host', 'false'],
['rootless', 'false'],
]),
{
source: {
type: 'image',
tag: '27.2.1',
},
setHost: false,
context: '',
daemonConfig: '',
rootless: false,
} as context.Inputs
],
[
8,
new Map<string, string>([
['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
],
])(
'[%d] given %p as inputs, returns %p',
async (num: number, inputs: Map<string, string>, expected: context.Inputs) => {

View File

@ -1,7 +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'
author: 'crazy-max'
name: Docker Setup Docker
description: Set up Docker for use in GitHub Actions by downloading and installing a version of Docker CE
author: docker
branding:
icon: 'anchor'
color: 'blue'
@ -24,6 +24,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:

18
dist/index.js generated vendored

File diff suppressed because one or more lines are too long

2
dist/index.js.map generated vendored

File diff suppressed because one or more lines are too long

View File

@ -15,19 +15,19 @@
},
"repository": {
"type": "git",
"url": "git+https://github.com/crazy-max/ghaction-setup-docker.git"
"url": "git+https://github.com/docker/setup-docker-action.git"
},
"keywords": [
"actions",
"docker",
"engine"
],
"author": "CrazyMax",
"author": "Docker Inc.",
"license": "Apache-2.0",
"packageManager": "yarn@3.6.3",
"dependencies": {
"@actions/core": "^1.11.1",
"@docker/actions-toolkit": "^0.40.0"
"@docker/actions-toolkit": "^0.47.0"
},
"devDependencies": {
"@types/node": "^20.6.0",

View File

@ -1,19 +1,98 @@
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;
rootless: 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')
setHost: core.getBooleanInput('set-host'),
rootless: core.getBooleanInput('rootless')
};
}
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;
}

View File

@ -21,13 +21,13 @@ actionsToolkit.run(
const install = new Install({
runDir: runDir,
version: input.version,
channel: input.channel || 'stable',
source: input.source,
rootless: input.rootless,
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();
});

View File

@ -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
@ -1103,12 +1102,12 @@ __metadata:
languageName: node
linkType: hard
"@docker/actions-toolkit@npm:^0.40.0":
version: 0.40.0
resolution: "@docker/actions-toolkit@npm:0.40.0"
"@docker/actions-toolkit@npm:^0.47.0":
version: 0.47.0
resolution: "@docker/actions-toolkit@npm:0.47.0"
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
@ -1119,7 +1118,7 @@ __metadata:
"@octokit/core": ^5.1.0
"@octokit/plugin-rest-endpoint-methods": ^10.4.0
async-retry: ^1.3.3
csv-parse: ^5.5.6
csv-parse: ^5.6.0
gunzip-maybe: ^1.4.2
handlebars: ^4.7.8
he: ^1.2.0
@ -1128,7 +1127,7 @@ __metadata:
semver: ^7.6.3
tar-stream: ^3.1.7
tmp: ^0.2.3
checksum: 38ac578e3659ddfefbcb39dbd51a9226e6eaedf797c99ad07e29fa710e7131abadf5fd30338c0197938574791760ed16e049179fb883fe288b73bb3761faf179
checksum: a0008259ab7108e4f74e1f8c5ec79d917032170e746e75f895828c3afd4120e4a72e4d8fd2dd620781a72fb5d663e491d1f84b39e4002199d5b2cd878c62913c
languageName: node
linkType: hard
@ -3220,20 +3219,20 @@ __metadata:
linkType: hard
"cross-spawn@npm:^7.0.0, cross-spawn@npm:^7.0.2, cross-spawn@npm:^7.0.3":
version: 7.0.3
resolution: "cross-spawn@npm:7.0.3"
version: 7.0.6
resolution: "cross-spawn@npm:7.0.6"
dependencies:
path-key: ^3.1.0
shebang-command: ^2.0.0
which: ^2.0.1
checksum: 671cc7c7288c3a8406f3c69a3ae2fc85555c04169e9d611def9a675635472614f1c0ed0ef80955d5b6d4e724f6ced67f0ad1bb006c2ea643488fcfef994d7f52
checksum: 8d306efacaf6f3f60e0224c287664093fa9185680b2d195852ba9a863f85d02dcc737094c6e512175f8ee0161f9b87c73c6826034c2422e39de7d6569cf4503b
languageName: node
linkType: hard
"csv-parse@npm:^5.5.6":
version: 5.5.6
resolution: "csv-parse@npm:5.5.6"
checksum: ee06f97f674487dc1d001b360de8ea510a41b9d971abf43bcf9c3be22c83a3634df0d3ebfbe52fd49d145077066be7ff9f25de3fc6b71aefb973099b04147a25
"csv-parse@npm:^5.6.0":
version: 5.6.0
resolution: "csv-parse@npm:5.6.0"
checksum: 173e176bdaf212bab37d0f6d39a06d039d24a1c0ee40b9f1023ebf8b36095934807deeb493c0fb58592b39b0682ccd0be5c9e8d2b137c08807e7031595ea7a51
languageName: node
linkType: hard
@ -3360,7 +3359,7 @@ __metadata:
resolution: "docker-setup-docker@workspace:."
dependencies:
"@actions/core": ^1.11.1
"@docker/actions-toolkit": ^0.40.0
"@docker/actions-toolkit": ^0.47.0
"@types/node": ^20.6.0
"@typescript-eslint/eslint-plugin": ^6.6.0
"@typescript-eslint/parser": ^6.6.0
@ -7106,7 +7105,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: