mirror of
https://github.com/docker/setup-docker-action.git
synced 2025-06-12 14:47:12 +02:00
Compare commits
242 Commits
Author | SHA1 | Date | |
---|---|---|---|
efe6ba76e3 | |||
1211ebfa1f | |||
63f2e57f85 | |||
b7bb1d4426 | |||
7db77378a9 | |||
2d89c571bd | |||
f27261ca18 | |||
a39f563e16 | |||
54c51f4ee8 | |||
364f5e215c | |||
b60f85385d | |||
643c69a8cb | |||
5c724e91b0 | |||
c2d73c1a11 | |||
bb512e8cb4 | |||
36de8cc80a | |||
f96ea45537 | |||
6b291a174a | |||
d44b774c56 | |||
057bfa9666 | |||
0f738e9bf9 | |||
a329cfc112 | |||
979ffe9e09 | |||
847482916a | |||
d6e275d4ff | |||
370a7dad4b | |||
23c3839175 | |||
b814c39737 | |||
75153b5b5e | |||
3a56725668 | |||
fde3095c59 | |||
d22c57e6c4 | |||
6172ee107f | |||
2a248d822c | |||
6dbd87054b | |||
68b1efda1d | |||
7188e7a998 | |||
927974f719 | |||
1439ace8f2 | |||
b86a7cc004 | |||
01efb57f88 | |||
f5dddcbf38 | |||
ccdfecaaf2 | |||
07f0e609c6 | |||
eff8d999dc | |||
57e629a437 | |||
5bf030df68 | |||
635d07c09d | |||
34a3d15d63 | |||
560d8b137b | |||
482b1d74c1 | |||
f0ff59fe55 | |||
939fbc5e6e | |||
a0bafae0b8 | |||
a37e5b7d61 | |||
f6d883591e | |||
02c50bf68d | |||
6ec0bb821a | |||
3b54d1cfdf | |||
eaea3291c9 | |||
8b555caf8d | |||
40162ae1f1 | |||
7d1184f528 | |||
2419f2cbba | |||
332d315257 | |||
343f86705e | |||
bcd97be19b | |||
e02739be38 | |||
0d3aa44c5c | |||
a508bb356e | |||
3e94cecda0 | |||
701f172a16 | |||
90aad53e72 | |||
a9ddd812ce | |||
91cbfc7996 | |||
7de04ecfd0 | |||
8321f1dc18 | |||
ff9a36b06e | |||
cd5049af64 | |||
810b53a8ba | |||
ba5a8c50ed | |||
8677037d08 | |||
ff2661333b | |||
26145a578d | |||
0692aeebfc | |||
47611ea40b | |||
7bb565780b | |||
9794ac9406 | |||
701bc4e9ed | |||
958155397b | |||
de4e249b98 | |||
a2e96b1577 | |||
2e05eb17ec | |||
b52307508d | |||
a3485f7b8f | |||
1977c86a96 | |||
e98084b722 | |||
ca246a1805 | |||
40c64fb090 | |||
4acbcb8479 | |||
8f832606d8 | |||
4f5bb9fcef | |||
da44386179 | |||
f4a5b99d88 | |||
c794b17d99 | |||
e188b1d368 | |||
e0c95fcf69 | |||
25cb73f3c4 | |||
a93701ec9b | |||
3a19e60609 | |||
78318f8be5 | |||
54f3988321 | |||
f437b67409 | |||
06b9bc80b3 | |||
a6fae2d4e8 | |||
a4ef905acc | |||
41a5151e81 | |||
e96e0e2c98 | |||
8d0a8e33ff | |||
9bd97ff018 | |||
bca5e4d3e2 | |||
031a2987b7 | |||
753106f35c | |||
a1e4314d8f | |||
a7f3aad3f5 | |||
faa196892b | |||
796ce734cb | |||
3eb24de4f6 | |||
5bddaa4323 | |||
17819a1af9 | |||
d20884258e | |||
b74351ab97 | |||
0f5a011c3d | |||
99cad45695 | |||
aceee1722e | |||
0cb459c59a | |||
81886c7276 | |||
fdc6583d4e | |||
a4b15f09d5 | |||
c2351bbd0b | |||
c14b6e1c32 | |||
f1d16883d0 | |||
5de1d6bef5 | |||
7d4fd999a5 | |||
38c07112bd | |||
c6f8a8a2ba | |||
2960188cea | |||
8e060aa468 | |||
fc6fa62ba9 | |||
7864da88cb | |||
36eedea576 | |||
95a170fa60 | |||
1ea15ee881 | |||
729d91c21f | |||
c553dd0c3f | |||
a307846a9f | |||
57929789e6 | |||
d9be6cade4 | |||
e1c24ba1f0 | |||
979d352bf6 | |||
db8a75eba6 | |||
69b561f709 | |||
c33ee55bce | |||
12e445b81b | |||
60457dabd3 | |||
8f158b20ff | |||
9057e9e607 | |||
addf8fa212 | |||
63346e6cc5 | |||
83adf3b3da | |||
828496ee08 | |||
df46d8995c | |||
6ac516eae5 | |||
df974f607b | |||
cf7c9d54cf | |||
1026ab4694 | |||
4c602a2061 | |||
806baaed75 | |||
cadd55dc3d | |||
f3fe780861 | |||
9aeea9f032 | |||
f920b5cca7 | |||
784197509a | |||
72f088c678 | |||
94fed099f6 | |||
87e8022576 | |||
64ced80536 | |||
cc7ab4747a | |||
2105ee4f68 | |||
32402da4e2 | |||
6a07d2066a | |||
8fac59bbad | |||
e031a1afa4 | |||
bba98f9cf3 | |||
c9a433aeef | |||
35358c035e | |||
ce60bfdfe1 | |||
24d5692d29 | |||
c322702919 | |||
ba6df22a99 | |||
751eb0de7b | |||
2c7b4c9ba9 | |||
0e98cdfc95 | |||
e5467b74ef | |||
d298db0f7d | |||
74272b7110 | |||
d3292ed6bc | |||
5566df4cd9 | |||
766484b9a8 | |||
1a21164cad | |||
0b0e2e14f8 | |||
3ff7a3f336 | |||
d1b108b3cc | |||
ff0fd563eb | |||
3edb28603d | |||
0a0eee06ff | |||
d00caf720d | |||
26bcb039d3 | |||
e22f202df2 | |||
99e070f51d | |||
f5b7761d05 | |||
2dcc4846c6 | |||
92951761fa | |||
dd105ffea1 | |||
8ad3d347be | |||
92e1039e6d | |||
50de6aefe9 | |||
a2ce6b1772 | |||
5265cc143e | |||
008acd5bc6 | |||
e8785f775f | |||
cb1f376ddb | |||
c3a68cbeca | |||
0a682c046a | |||
e4a53ed864 | |||
3dcc76c352 | |||
d131482129 | |||
59b62980d1 | |||
475e5bf1db | |||
a7db17d9b4 | |||
34c4964b4a | |||
3e758a2d14 |
@ -1,2 +1,12 @@
|
||||
/coverage
|
||||
/node_modules
|
||||
|
||||
# Dependency directories
|
||||
node_modules/
|
||||
jspm_packages/
|
||||
|
||||
# yarn v2
|
||||
.yarn/cache
|
||||
.yarn/unplugged
|
||||
.yarn/build-state.yml
|
||||
.yarn/install-state.gz
|
||||
.pnp.*
|
||||
|
3
.eslintignore
Normal file
3
.eslintignore
Normal file
@ -0,0 +1,3 @@
|
||||
/dist/**
|
||||
/coverage/**
|
||||
/node_modules/**
|
@ -1,11 +1,12 @@
|
||||
{
|
||||
"env": {
|
||||
"node": true,
|
||||
"es2021": true,
|
||||
"es6": true,
|
||||
"jest": true
|
||||
},
|
||||
"extends": [
|
||||
"eslint:recommended",
|
||||
"plugin:@typescript-eslint/eslint-recommended",
|
||||
"plugin:@typescript-eslint/recommended",
|
||||
"plugin:jest/recommended",
|
||||
"plugin:prettier/recommended"
|
||||
|
2
.gitattributes
vendored
2
.gitattributes
vendored
@ -1,2 +1,4 @@
|
||||
/.yarn/releases/** binary
|
||||
/.yarn/plugins/** binary
|
||||
/dist/** linguist-generated=true
|
||||
/lib/** linguist-generated=true
|
||||
|
1
.github/CODEOWNERS
vendored
1
.github/CODEOWNERS
vendored
@ -1 +0,0 @@
|
||||
* @crazy-max
|
3
.github/CODE_OF_CONDUCT.md
vendored
Normal file
3
.github/CODE_OF_CONDUCT.md
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
# Code of conduct
|
||||
|
||||
- [Moby community guidelines](https://github.com/moby/moby/blob/master/CONTRIBUTING.md#moby-community-guidelines)
|
4
.github/CONTRIBUTING.md
vendored
4
.github/CONTRIBUTING.md
vendored
@ -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
102
.github/ISSUE_TEMPLATE/bug.yml
vendored
Normal 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.
|
34
.github/ISSUE_TEMPLATE/bug_report.md
vendored
34
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@ -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
6
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal 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
15
.github/ISSUE_TEMPLATE/feature.yml
vendored
Normal 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
12
.github/SECURITY.md
vendored
Normal 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—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
31
.github/SUPPORT.md
vendored
@ -1,31 +0,0 @@
|
||||
# Support [](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.
|
5
.github/dependabot.yml
vendored
5
.github/dependabot.yml
vendored
@ -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"
|
||||
|
305
.github/workflows/ci.yml
vendored
305
.github/workflows/ci.yml
vendored
@ -1,6 +1,11 @@
|
||||
name: ci
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
- cron: '0 10 * * *'
|
||||
push:
|
||||
@ -11,6 +16,10 @@ on:
|
||||
- 'v*'
|
||||
pull_request:
|
||||
|
||||
env:
|
||||
DOCKER_VERSION: v27.3.1
|
||||
DOCKER_BUILD_SUMMARY: false
|
||||
|
||||
jobs:
|
||||
main:
|
||||
runs-on: ${{ matrix.os }}
|
||||
@ -19,14 +28,304 @@ jobs:
|
||||
matrix:
|
||||
os:
|
||||
- ubuntu-latest
|
||||
- macos-latest
|
||||
- ubuntu-24.04-arm
|
||||
#- macos-14 # no virt: https://github.com/docker/actions-toolkit/issues/317
|
||||
- macos-13
|
||||
- windows-latest
|
||||
version:
|
||||
- ""
|
||||
- v27.3.1
|
||||
- type=image,tag=27.3.1
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
-
|
||||
name: Set up Docker
|
||||
uses: ./
|
||||
with:
|
||||
version: 23.0.0
|
||||
version: ${{ matrix.version }}
|
||||
|
||||
channel:
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os:
|
||||
- ubuntu-latest
|
||||
- ubuntu-24.04-arm
|
||||
#- 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
|
||||
uses: ./
|
||||
with:
|
||||
version: ${{ env.DOCKER_VERSION }}
|
||||
channel: test
|
||||
|
||||
daemon-config:
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os:
|
||||
- ubuntu-latest
|
||||
- ubuntu-24.04-arm
|
||||
#- 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
|
||||
uses: ./
|
||||
with:
|
||||
version: ${{ env.DOCKER_VERSION }}
|
||||
daemon-config: |
|
||||
{
|
||||
"debug": true,
|
||||
"features": {
|
||||
"containerd-snapshotter": true
|
||||
}
|
||||
}
|
||||
|
||||
context:
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os:
|
||||
- ubuntu-latest
|
||||
- ubuntu-24.04-arm
|
||||
#- 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
|
||||
uses: ./
|
||||
with:
|
||||
version: ${{ env.DOCKER_VERSION }}
|
||||
context: foo
|
||||
-
|
||||
name: Check context
|
||||
run: |
|
||||
docker context inspect foo
|
||||
|
||||
lima-start-args:
|
||||
#runs-on: macos-14 # no virt: https://github.com/docker/actions-toolkit/issues/317
|
||||
runs-on: macos-13
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
-
|
||||
name: Set up Docker
|
||||
uses: ./
|
||||
with:
|
||||
version: ${{ env.DOCKER_VERSION }}
|
||||
env:
|
||||
LIMA_START_ARGS: --cpus 4 --memory 8
|
||||
|
||||
build-linux:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
containerd:
|
||||
- containerd-system
|
||||
- containerd-tarball
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
-
|
||||
name: Uninstall containerd
|
||||
if: matrix.containerd == 'containerd-tarball'
|
||||
run: |
|
||||
sudo apt-get remove -y containerd.io
|
||||
-
|
||||
name: Set up Docker
|
||||
uses: ./
|
||||
with:
|
||||
version: ${{ env.DOCKER_VERSION }}
|
||||
-
|
||||
name: Start registry
|
||||
run: |
|
||||
docker run -d -p 5000:5000 --restart=always --name registry registry:2
|
||||
-
|
||||
name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
with:
|
||||
driver: docker
|
||||
driver-opts: network=host
|
||||
-
|
||||
name: Build and push
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: ./test
|
||||
push: true
|
||||
tags: |
|
||||
localhost:5000/name/app:latest
|
||||
-
|
||||
name: Inspect
|
||||
run: |
|
||||
docker buildx imagetools inspect localhost:5000/name/app:latest --format '{{json .}}'
|
||||
|
||||
build-macos:
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os:
|
||||
#- macos-14 # no virt: https://github.com/docker/actions-toolkit/issues/317
|
||||
- macos-13
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
-
|
||||
name: Set up Docker
|
||||
uses: ./
|
||||
with:
|
||||
version: ${{ env.DOCKER_VERSION }}
|
||||
-
|
||||
name: Start registry
|
||||
run: |
|
||||
docker run -d -p 5000:5000 --restart=always --name registry registry:2
|
||||
-
|
||||
name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
with:
|
||||
driver: docker
|
||||
driver-opts: network=host
|
||||
-
|
||||
name: Build and push
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: ./test
|
||||
push: true
|
||||
tags: |
|
||||
localhost:5000/name/app:latest
|
||||
-
|
||||
name: Inspect
|
||||
run: |
|
||||
docker buildx imagetools inspect localhost:5000/name/app:latest --format '{{json .}}'
|
||||
|
||||
build-windows:
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
-
|
||||
name: Set up Docker
|
||||
uses: ./
|
||||
with:
|
||||
version: ${{ env.DOCKER_VERSION }}
|
||||
-
|
||||
name: Build
|
||||
working-directory: ./test
|
||||
run: |
|
||||
docker build -f win.Dockerfile -t test .
|
||||
-
|
||||
name: Inspect
|
||||
run: |
|
||||
docker image inspect test
|
||||
|
||||
set-host:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
-
|
||||
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: Checkout
|
||||
uses: actions/checkout@v4
|
||||
-
|
||||
name: Set up Docker
|
||||
uses: ./
|
||||
with:
|
||||
version: ${{ env.DOCKER_VERSION }}
|
||||
rootless: true
|
||||
-
|
||||
name: List contexts
|
||||
run: |
|
||||
docker context ls
|
||||
|
||||
tcp:
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os:
|
||||
- ubuntu-latest
|
||||
- ubuntu-24.04-arm
|
||||
#- 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 }}
|
||||
|
||||
undock-regctl-version:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
undock_version:
|
||||
- ''
|
||||
- v0.9.0
|
||||
regctl_version:
|
||||
- ''
|
||||
- v0.8.2
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
-
|
||||
name: Set up Docker
|
||||
uses: ./
|
||||
with:
|
||||
version: type=image
|
||||
env:
|
||||
UNDOCK_VERSION: ${{ matrix.undock_version }}
|
||||
REGCTL_VERSION: ${{ matrix.regctl_version }}
|
||||
|
17
.github/workflows/pr-assign-author.yml
vendored
Normal file
17
.github/workflows/pr-assign-author.yml
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
name: pr-assign-author
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
on:
|
||||
pull_request_target:
|
||||
types:
|
||||
- opened
|
||||
- reopened
|
||||
|
||||
jobs:
|
||||
run:
|
||||
uses: crazy-max/.github/.github/workflows/pr-assign-author.yml@1b673f36fad86812f538c1df9794904038a23cbf
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: write
|
21
.github/workflows/publish.yml
vendored
Normal file
21
.github/workflows/publish.yml
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
name: publish
|
||||
|
||||
on:
|
||||
release:
|
||||
types:
|
||||
- published
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
id-token: write
|
||||
packages: write
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
-
|
||||
name: Publish
|
||||
uses: actions/publish-immutable-action@v0.0.4
|
14
.github/workflows/test.yml
vendored
14
.github/workflows/test.yml
vendored
@ -1,5 +1,9 @@
|
||||
name: test
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
@ -13,14 +17,16 @@ jobs:
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
-
|
||||
name: Test
|
||||
uses: docker/bake-action@v2
|
||||
uses: docker/bake-action@v6
|
||||
with:
|
||||
targets: test
|
||||
-
|
||||
name: Upload coverage
|
||||
uses: codecov/codecov-action@v3
|
||||
uses: codecov/codecov-action@v5
|
||||
with:
|
||||
file: ./coverage/clover.xml
|
||||
source: .
|
||||
files: ./coverage/clover.xml
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
|
22
.github/workflows/validate.yml
vendored
22
.github/workflows/validate.yml
vendored
@ -1,5 +1,9 @@
|
||||
name: validate
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
@ -11,16 +15,17 @@ jobs:
|
||||
prepare:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
targets: ${{ steps.targets.outputs.matrix }}
|
||||
targets: ${{ steps.generate.outputs.targets }}
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
-
|
||||
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
|
||||
@ -31,11 +36,8 @@ jobs:
|
||||
matrix:
|
||||
target: ${{ fromJson(needs.prepare.outputs.targets) }}
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
-
|
||||
name: Validate
|
||||
uses: docker/bake-action@v2
|
||||
uses: docker/bake-action@v6
|
||||
with:
|
||||
targets: ${{ matrix.target }}
|
||||
|
66
.gitignore
vendored
66
.gitignore
vendored
@ -1,7 +1,5 @@
|
||||
node_modules
|
||||
lib
|
||||
# https://raw.githubusercontent.com/github/gitignore/main/Node.gitignore
|
||||
|
||||
# Rest of the file pulled from https://github.com/github/gitignore/blob/master/Node.gitignore
|
||||
# Logs
|
||||
logs
|
||||
*.log
|
||||
@ -9,6 +7,7 @@ npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
lerna-debug.log*
|
||||
.pnpm-debug.log*
|
||||
|
||||
# Diagnostic reports (https://nodejs.org/api/report.html)
|
||||
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
|
||||
@ -19,34 +18,14 @@ pids
|
||||
*.seed
|
||||
*.pid.lock
|
||||
|
||||
# Directory for instrumented libs generated by jscoverage/JSCover
|
||||
lib-cov
|
||||
|
||||
# Coverage directory used by tools like istanbul
|
||||
coverage
|
||||
*.lcov
|
||||
|
||||
# nyc test coverage
|
||||
.nyc_output
|
||||
|
||||
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
|
||||
.grunt
|
||||
|
||||
# Bower dependency directory (https://bower.io/)
|
||||
bower_components
|
||||
|
||||
# node-waf configuration
|
||||
.lock-wscript
|
||||
|
||||
# Compiled binary addons (https://nodejs.org/api/addons.html)
|
||||
build/Release
|
||||
|
||||
# Dependency directories
|
||||
node_modules/
|
||||
jspm_packages/
|
||||
|
||||
# TypeScript v1 declaration files
|
||||
typings/
|
||||
|
||||
# TypeScript cache
|
||||
*.tsbuildinfo
|
||||
|
||||
@ -56,36 +35,19 @@ typings/
|
||||
# Optional eslint cache
|
||||
.eslintcache
|
||||
|
||||
# Optional REPL history
|
||||
.node_repl_history
|
||||
|
||||
# Output of 'npm pack'
|
||||
*.tgz
|
||||
|
||||
# Yarn Integrity file
|
||||
.yarn-integrity
|
||||
|
||||
# dotenv environment variables file
|
||||
# dotenv environment variable files
|
||||
.env
|
||||
.env.test
|
||||
.env.development.local
|
||||
.env.test.local
|
||||
.env.production.local
|
||||
.env.local
|
||||
|
||||
# parcel-bundler cache (https://parceljs.org/)
|
||||
.cache
|
||||
|
||||
# next.js build output
|
||||
.next
|
||||
|
||||
# nuxt.js build output
|
||||
.nuxt
|
||||
|
||||
# vuepress build output
|
||||
.vuepress/dist
|
||||
|
||||
# Serverless directories
|
||||
.serverless/
|
||||
|
||||
# FuseBox cache
|
||||
.fusebox/
|
||||
|
||||
# DynamoDB Local files
|
||||
.dynamodb/
|
||||
# yarn v2
|
||||
.yarn/cache
|
||||
.yarn/unplugged
|
||||
.yarn/build-state.yml
|
||||
.yarn/install-state.gz
|
||||
.pnp.*
|
||||
|
6
.prettierignore
Normal file
6
.prettierignore
Normal file
@ -0,0 +1,6 @@
|
||||
# Dependency directories
|
||||
node_modules/
|
||||
jspm_packages/
|
||||
|
||||
# yarn v2
|
||||
.yarn/
|
541
.yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
vendored
Normal file
541
.yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
vendored
Normal file
File diff suppressed because one or more lines are too long
13
.yarnrc.yml
Normal file
13
.yarnrc.yml
Normal file
@ -0,0 +1,13 @@
|
||||
logFilters:
|
||||
- code: YN0013
|
||||
level: discard
|
||||
- code: YN0019
|
||||
level: discard
|
||||
- code: YN0076
|
||||
level: discard
|
||||
|
||||
nodeLinker: node-modules
|
||||
|
||||
plugins:
|
||||
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
|
||||
spec: "@yarnpkg/plugin-interactive-tools"
|
179
README.md
179
README.md
@ -1,25 +1,45 @@
|
||||
[](https://github.com/crazy-max/ghaction-setup-docker/releases/latest)
|
||||
[](https://github.com/docker/setup-docker-action/releases/latest)
|
||||
[](https://github.com/marketplace/actions/docker-setup-docker)
|
||||
[](https://github.com/crazy-max/ghaction-setup-docker/actions?workflow=ci)
|
||||
[](https://github.com/crazy-max/ghaction-setup-docker/actions?workflow=test)
|
||||
[](https://codecov.io/gh/crazy-max/ghaction-setup-docker)
|
||||
[](https://github.com/docker/setup-docker-action/actions?workflow=ci)
|
||||
[](https://github.com/docker/setup-docker-action/actions?workflow=test)
|
||||
[](https://codecov.io/gh/docker/setup-docker-action)
|
||||
|
||||
## About
|
||||
|
||||
GitHub Action to set up [Docker CE](https://docs.docker.com/engine/). Works on
|
||||
Linux, macOS and Windows.
|
||||
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
|
||||
> * https://github.com/docker/actions-toolkit/issues/317
|
||||
|
||||

|
||||
|
||||
___
|
||||
|
||||
* [Usage](#usage)
|
||||
* [Quick start](#quick-start)
|
||||
* [Daemon configuration](#daemon-configuration)
|
||||
* [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)
|
||||
|
||||
## Usage
|
||||
|
||||
### Quick start
|
||||
|
||||
```yaml
|
||||
name: ci
|
||||
|
||||
@ -32,22 +52,157 @@ jobs:
|
||||
steps:
|
||||
-
|
||||
name: Set up Docker
|
||||
uses: crazy-max/ghaction-setup-docker@v1
|
||||
uses: docker/setup-docker-action@v4
|
||||
```
|
||||
|
||||
### Daemon configuration
|
||||
|
||||
You can [configure the Docker daemon](https://docs.docker.com/engine/reference/commandline/dockerd/#daemon-configuration-file)
|
||||
using the `daemon-config` input. In the following example, we configure the
|
||||
Docker daemon to enable debug and the [containerd image store](https://docs.docker.com/storage/containerd/)
|
||||
feature:
|
||||
|
||||
```yaml
|
||||
name: ci
|
||||
|
||||
on:
|
||||
push:
|
||||
|
||||
jobs:
|
||||
docker:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
-
|
||||
name: Set up Docker
|
||||
uses: docker/setup-docker-action@v4
|
||||
with:
|
||||
version: 23.0.1
|
||||
daemon-config: |
|
||||
{
|
||||
"debug": true,
|
||||
"features": {
|
||||
"containerd-snapshotter": true
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Define custom `limactl start` arguments (macOS)
|
||||
|
||||
You can define custom [`limactl start` arguments](https://lima-vm.io/docs/reference/limactl_start/)
|
||||
using the `LIMA_START_ARGS` environment variable to customize the VM:
|
||||
|
||||
```yaml
|
||||
name: ci
|
||||
|
||||
on:
|
||||
push:
|
||||
|
||||
jobs:
|
||||
docker:
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
-
|
||||
name: Set up Docker
|
||||
uses: docker/setup-docker-action@v4
|
||||
env:
|
||||
LIMA_START_ARGS: --cpus 4 --memory 8
|
||||
```
|
||||
|
||||
## Customizing
|
||||
|
||||
### inputs
|
||||
|
||||
Following inputs can be used as `step.with` keys
|
||||
The following inputs can be used as `step.with` keys
|
||||
|
||||
| Name | Type | Description |
|
||||
|-----------|--------|-------------------------------------|
|
||||
| `version` | String | Docker CE version (e.g., `23.0.1`). |
|
||||
| Name | Type | Default | Description |
|
||||
|-----------------|--------|-----------------------|-----------------------------------------------------------------------------------------------------------------------------|
|
||||
| `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
|
||||
|
||||
| Name | Type | Description |
|
||||
|--------|--------|---------------------------------------|
|
||||
| `sock` | String | Docker socket path |
|
||||
| `tcp` | String | Docker TCP address if tcp-port is set |
|
||||
|
||||
## Contributing
|
||||
|
||||
Want to contribute? Awesome! You can find information about contributing to
|
||||
this project in the [CONTRIBUTING.md](/.github/CONTRIBUTING.md)
|
||||
|
||||
## License
|
||||
|
||||
Apache-2.0. See `LICENSE` for more details.
|
||||
|
@ -17,12 +17,195 @@ describe('getInputs', () => {
|
||||
[
|
||||
0,
|
||||
new Map<string, string>([
|
||||
['version', '23.0.1'],
|
||||
['version', 'v24.0.8'],
|
||||
['set-host', 'false'],
|
||||
['rootless', 'false'],
|
||||
]),
|
||||
{
|
||||
version: '23.0.1',
|
||||
source: {
|
||||
type: 'archive',
|
||||
version: 'v24.0.8',
|
||||
channel: 'stable'
|
||||
},
|
||||
context: '',
|
||||
daemonConfig: '',
|
||||
rootless: false,
|
||||
setHost: false
|
||||
} as context.Inputs
|
||||
]
|
||||
],
|
||||
[
|
||||
1,
|
||||
new Map<string, string>([
|
||||
['version', 'v24.0.0-rc.4'],
|
||||
['channel', 'test'],
|
||||
['context', 'foo'],
|
||||
['daemon-config', `{"debug":true,"features":{"containerd-snapshotter":true}}`],
|
||||
['set-host', 'false'],
|
||||
['rootless', 'false'],
|
||||
]),
|
||||
{
|
||||
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
|
||||
],
|
||||
[
|
||||
2,
|
||||
new Map<string, string>([
|
||||
['set-host', 'true'],
|
||||
['rootless', 'false'],
|
||||
]),
|
||||
{
|
||||
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
|
||||
],
|
||||
[
|
||||
9,
|
||||
new Map<string, string>([
|
||||
['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<string, string>, expected: context.Inputs) => {
|
||||
|
37
action.yml
37
action.yml
@ -1,17 +1,44 @@
|
||||
# https://help.github.com/en/articles/metadata-syntax-for-github-actions
|
||||
name: 'Docker Setup Docker'
|
||||
description: 'Set up Docker'
|
||||
author: 'docker'
|
||||
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'
|
||||
|
||||
inputs:
|
||||
version:
|
||||
description: 'Docker CE version. (e.g, 23.0.1)'
|
||||
description: 'Docker CE version. (e.g, v24.0.9)'
|
||||
required: false
|
||||
default: 'latest'
|
||||
channel:
|
||||
description: 'Docker CE channel. (e.g, stable, edge or test)'
|
||||
required: false
|
||||
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
|
||||
set-host:
|
||||
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:
|
||||
description: "Docker socket path"
|
||||
tcp:
|
||||
description: "Docker TCP address if tcp-port is set"
|
||||
|
||||
runs:
|
||||
using: 'node16'
|
||||
using: 'node20'
|
||||
main: 'dist/index.js'
|
||||
post: 'dist/index.js'
|
||||
|
@ -1,3 +1,12 @@
|
||||
comment: false
|
||||
|
||||
coverage:
|
||||
status:
|
||||
project: # settings affecting project coverage
|
||||
default:
|
||||
target: auto # auto % coverage target
|
||||
threshold: 5% # allow for 5% reduction of coverage without failing
|
||||
patch: off
|
||||
|
||||
github_checks:
|
||||
annotations: false
|
||||
|
@ -1,13 +1,20 @@
|
||||
# syntax=docker/dockerfile:1
|
||||
|
||||
ARG NODE_VERSION=16
|
||||
ARG NODE_VERSION=20
|
||||
|
||||
FROM node:${NODE_VERSION}-alpine AS base
|
||||
RUN apk add --no-cache cpio findutils git
|
||||
WORKDIR /src
|
||||
RUN --mount=type=bind,target=.,rw \
|
||||
--mount=type=cache,target=/src/.yarn/cache <<EOT
|
||||
corepack enable
|
||||
yarn --version
|
||||
yarn config set --home enableTelemetry 0
|
||||
EOT
|
||||
|
||||
FROM base AS deps
|
||||
RUN --mount=type=bind,target=.,rw \
|
||||
--mount=type=cache,target=/src/.yarn/cache \
|
||||
--mount=type=cache,target=/src/node_modules \
|
||||
yarn install && mkdir /vendor && cp yarn.lock /vendor
|
||||
|
||||
@ -28,6 +35,7 @@ EOT
|
||||
|
||||
FROM deps AS build
|
||||
RUN --mount=type=bind,target=.,rw \
|
||||
--mount=type=cache,target=/src/.yarn/cache \
|
||||
--mount=type=cache,target=/src/node_modules \
|
||||
yarn run build && mkdir /out && cp -Rf dist /out/
|
||||
|
||||
@ -48,6 +56,7 @@ EOT
|
||||
|
||||
FROM deps AS format
|
||||
RUN --mount=type=bind,target=.,rw \
|
||||
--mount=type=cache,target=/src/.yarn/cache \
|
||||
--mount=type=cache,target=/src/node_modules \
|
||||
yarn run format \
|
||||
&& mkdir /out && find . -name '*.ts' -not -path './node_modules/*' | cpio -pdm /out
|
||||
@ -57,13 +66,15 @@ COPY --from=format /out /
|
||||
|
||||
FROM deps AS lint
|
||||
RUN --mount=type=bind,target=.,rw \
|
||||
--mount=type=cache,target=/src/.yarn/cache \
|
||||
--mount=type=cache,target=/src/node_modules \
|
||||
yarn run lint
|
||||
|
||||
FROM deps AS test
|
||||
RUN --mount=type=bind,target=.,rw \
|
||||
--mount=type=cache,target=/src/.yarn/cache \
|
||||
--mount=type=cache,target=/src/node_modules \
|
||||
yarn run test --coverageDirectory=/tmp/coverage
|
||||
yarn run test --coverage --coverageDirectory=/tmp/coverage
|
||||
|
||||
FROM scratch AS test-coverage
|
||||
COPY --from=test /tmp/coverage /
|
||||
|
93
dist/index.js
generated
vendored
93
dist/index.js
generated
vendored
File diff suppressed because one or more lines are too long
2
dist/index.js.map
generated
vendored
2
dist/index.js.map
generated
vendored
File diff suppressed because one or more lines are too long
3331
dist/licenses.txt
generated
vendored
3331
dist/licenses.txt
generated
vendored
File diff suppressed because it is too large
Load Diff
2
dist/sourcemap-register.js
generated
vendored
2
dist/sourcemap-register.js
generated
vendored
File diff suppressed because one or more lines are too long
@ -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"]
|
||||
|
@ -15,6 +15,7 @@ process.env = Object.assign({}, process.env, {
|
||||
|
||||
module.exports = {
|
||||
clearMocks: true,
|
||||
testEnvironment: 'node',
|
||||
moduleFileExtensions: ['js', 'ts'],
|
||||
testMatch: ['**/*.test.ts'],
|
||||
transform: {
|
||||
|
54
package.json
54
package.json
@ -1,49 +1,47 @@
|
||||
{
|
||||
"name": "docker-setup-docker",
|
||||
"description": "Set up Docker CE",
|
||||
"description": "Set up Docker for use in GitHub Actions by downloading and installing a version of Docker CE",
|
||||
"main": "lib/main.js",
|
||||
"scripts": {
|
||||
"build": "ncc build src/main.ts --source-map --minify --license licenses.txt",
|
||||
"lint": "eslint src/**/*.ts __tests__/**/*.ts",
|
||||
"format": "eslint --fix src/**/*.ts __tests__/**/*.ts",
|
||||
"test": "jest --coverage",
|
||||
"lint": "yarn run prettier && yarn run eslint",
|
||||
"format": "yarn run prettier:fix && yarn run eslint:fix",
|
||||
"eslint": "eslint --max-warnings=0 .",
|
||||
"eslint:fix": "eslint --fix .",
|
||||
"prettier": "prettier --check \"./**/*.ts\"",
|
||||
"prettier:fix": "prettier --write \"./**/*.ts\"",
|
||||
"test": "jest",
|
||||
"all": "yarn run build && yarn run format && yarn test"
|
||||
},
|
||||
"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": "Docker",
|
||||
"contributors": [
|
||||
{
|
||||
"name": "CrazyMax",
|
||||
"url": "https://crazymax.dev"
|
||||
}
|
||||
],
|
||||
"author": "Docker Inc.",
|
||||
"license": "Apache-2.0",
|
||||
"packageManager": "yarn@3.6.3",
|
||||
"dependencies": {
|
||||
"@actions/core": "^1.10.0",
|
||||
"@docker/actions-toolkit": "^0.1.0-beta.17",
|
||||
"uuid": "^9.0.0"
|
||||
"@actions/core": "^1.11.1",
|
||||
"@docker/actions-toolkit": "^0.61.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^16.11.26",
|
||||
"@typescript-eslint/eslint-plugin": "^5.14.0",
|
||||
"@typescript-eslint/parser": "^5.14.0",
|
||||
"@vercel/ncc": "^0.33.3",
|
||||
"eslint": "^8.11.0",
|
||||
"eslint-config-prettier": "^8.5.0",
|
||||
"eslint-plugin-jest": "^26.1.1",
|
||||
"eslint-plugin-prettier": "^4.0.0",
|
||||
"jest": "^27.2.5",
|
||||
"prettier": "^2.3.1",
|
||||
"ts-jest": "^27.1.2",
|
||||
"ts-node": "^10.7.0",
|
||||
"typescript": "^4.4.4"
|
||||
"@types/node": "^20.6.0",
|
||||
"@typescript-eslint/eslint-plugin": "^6.6.0",
|
||||
"@typescript-eslint/parser": "^6.6.0",
|
||||
"@vercel/ncc": "^0.38.0",
|
||||
"eslint": "^8.49.0",
|
||||
"eslint-config-prettier": "^9.0.0",
|
||||
"eslint-plugin-jest": "^27.2.3",
|
||||
"eslint-plugin-prettier": "^5.0.0",
|
||||
"jest": "^29.6.4",
|
||||
"prettier": "^3.0.3",
|
||||
"ts-jest": "^29.1.1",
|
||||
"ts-node": "^10.9.1",
|
||||
"typescript": "^5.2.2"
|
||||
}
|
||||
}
|
||||
|
@ -1,11 +1,102 @@
|
||||
import * as core from '@actions/core';
|
||||
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 {
|
||||
version: string;
|
||||
source: InstallSource;
|
||||
daemonConfig?: string;
|
||||
tcpPort?: number;
|
||||
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')
|
||||
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')
|
||||
};
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
85
src/main.ts
85
src/main.ts
@ -1,30 +1,95 @@
|
||||
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';
|
||||
import {Docker} from '@docker/actions-toolkit/lib/docker/docker';
|
||||
import {Install as RegclientInstall} from '@docker/actions-toolkit/lib/regclient/install';
|
||||
import {Regctl} from '@docker/actions-toolkit/lib/regclient/regctl';
|
||||
import {Install as UndockInstall} from '@docker/actions-toolkit/lib/undock/install';
|
||||
import {Undock} from '@docker/actions-toolkit/lib/undock/undock';
|
||||
|
||||
import * as context from './context';
|
||||
import * as stateHelper from './state-helper';
|
||||
|
||||
const regctlDefaultVersion = 'v0.8.3';
|
||||
const undockDefaultVersion = 'v0.10.0';
|
||||
|
||||
actionsToolkit.run(
|
||||
// main
|
||||
async () => {
|
||||
const input: context.Inputs = context.getInputs();
|
||||
const runDir = path.join(os.homedir(), `setup-docker-action-${crypto.randomUUID().slice(0, 8)}`);
|
||||
|
||||
const install = new Install();
|
||||
if (input.context == 'default') {
|
||||
throw new Error(`'default' context cannot be used.`);
|
||||
}
|
||||
|
||||
if (input.source.type === 'image') {
|
||||
await core.group(`Download and install regctl`, async () => {
|
||||
const regclientInstall = new RegclientInstall();
|
||||
const regclientBinPath = await regclientInstall.download(
|
||||
process.env.REGCTL_VERSION && process.env.REGCTL_VERSION.trim()
|
||||
? process.env.REGCTL_VERSION
|
||||
: regctlDefaultVersion,
|
||||
true
|
||||
);
|
||||
await regclientInstall.install(regclientBinPath);
|
||||
});
|
||||
await core.group(`Download and install undock`, async () => {
|
||||
const undockInstall = new UndockInstall();
|
||||
const undockBinPath = await undockInstall.download(
|
||||
process.env.UNDOCK_VERSION && process.env.UNDOCK_VERSION.trim()
|
||||
? process.env.UNDOCK_VERSION
|
||||
: undockDefaultVersion,
|
||||
true
|
||||
);
|
||||
await undockInstall.install(undockBinPath);
|
||||
});
|
||||
}
|
||||
|
||||
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,
|
||||
localTCPPort: tcpPort,
|
||||
regctl: new Regctl(),
|
||||
undock: new Undock()
|
||||
});
|
||||
let toolDir;
|
||||
if (!(await Docker.isAvailable()) || input.version) {
|
||||
if (!(await Docker.isAvailable()) || input.source) {
|
||||
await core.group(`Download docker`, async () => {
|
||||
toolDir = await install.download(input.version || 'latest');
|
||||
toolDir = await install.download();
|
||||
});
|
||||
}
|
||||
if (toolDir) {
|
||||
const runDir = path.join(os.homedir(), `setup-docker-action-${uuid.v4()}`);
|
||||
stateHelper.setRunDir(runDir);
|
||||
await install.install(toolDir, runDir, input.version);
|
||||
const sockPath = await install.install();
|
||||
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) {
|
||||
await core.group(`Setting Docker host`, async () => {
|
||||
core.exportVariable('DOCKER_HOST', sockPath);
|
||||
core.info(`DOCKER_HOST=${sockPath}`);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
await core.group(`Docker info`, async () => {
|
||||
@ -37,7 +102,11 @@ actionsToolkit.run(
|
||||
if (stateHelper.runDir.length == 0) {
|
||||
return;
|
||||
}
|
||||
const install = new Install();
|
||||
await install.tearDown(stateHelper.runDir);
|
||||
const install = new Install({
|
||||
runDir: stateHelper.runDir,
|
||||
regctl: new Regctl(),
|
||||
undock: new Undock()
|
||||
});
|
||||
await install.tearDown();
|
||||
}
|
||||
);
|
||||
|
9
test/Dockerfile
Normal file
9
test/Dockerfile
Normal file
@ -0,0 +1,9 @@
|
||||
# syntax=docker/dockerfile:1
|
||||
|
||||
FROM --platform=$BUILDPLATFORM golang:alpine AS build
|
||||
ARG TARGETPLATFORM
|
||||
ARG BUILDPLATFORM
|
||||
RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM" > /log
|
||||
|
||||
FROM alpine
|
||||
COPY --from=build /log /log
|
22
test/hello.txt
Normal file
22
test/hello.txt
Normal file
@ -0,0 +1,22 @@
|
||||
|
||||
Hello from Docker!
|
||||
This message shows that your installation appears to be working correctly.
|
||||
|
||||
To generate this message, Docker took the following steps:
|
||||
1. The Docker client contacted the Docker daemon.
|
||||
2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
|
||||
(windows-amd64, nanoserver-1809)
|
||||
3. The Docker daemon created a new container from that image which runs the
|
||||
executable that produces the output you are currently reading.
|
||||
4. The Docker daemon streamed that output to the Docker client, which sent it
|
||||
to your terminal.
|
||||
|
||||
To try something more ambitious, you can run a Windows Server container with:
|
||||
PS C:\> docker run -it mcr.microsoft.com/windows/servercore:ltsc2019 powershell
|
||||
|
||||
Share images, automate workflows, and more with a free Docker ID:
|
||||
https://hub.docker.com/
|
||||
|
||||
For more examples and ideas, visit:
|
||||
https://docs.docker.com/get-started/
|
||||
|
3
test/win.Dockerfile
Normal file
3
test/win.Dockerfile
Normal file
@ -0,0 +1,3 @@
|
||||
FROM mcr.microsoft.com/windows/nanoserver:1809
|
||||
COPY hello.txt C:
|
||||
CMD ["cmd", "/C", "type C:\\hello.txt"]
|
@ -3,7 +3,6 @@
|
||||
"esModuleInterop": true,
|
||||
"target": "es6",
|
||||
"module": "commonjs",
|
||||
"strict": true,
|
||||
"newLine": "lf",
|
||||
"outDir": "./lib",
|
||||
"rootDir": "./src",
|
||||
@ -13,9 +12,8 @@
|
||||
"useUnknownInCatchVariables": false,
|
||||
},
|
||||
"exclude": [
|
||||
"./__tests__/**/*",
|
||||
"./lib/**/*",
|
||||
"node_modules",
|
||||
"**/*.test.ts",
|
||||
"jest.config.ts"
|
||||
]
|
||||
}
|
||||
|
Reference in New Issue
Block a user