mirror of
https://github.com/docker/build-push-action.git
synced 2026-03-19 06:08:09 +08:00
Compare commits
11 Commits
v7.0.0
...
dependabot
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7ccd4aacaa | ||
|
|
51887b8a56 | ||
|
|
eb6512707b | ||
|
|
1031bc45c5 | ||
|
|
344ec24f8d | ||
|
|
dbac3ca1e5 | ||
|
|
b0bdd3ad21 | ||
|
|
3cb57ac71c | ||
|
|
f64672cf50 | ||
|
|
63e92d1fdf | ||
|
|
155e77ab84 |
2
.github/workflows/.e2e-run.yml
vendored
2
.github/workflows/.e2e-run.yml
vendored
@@ -83,7 +83,7 @@ jobs:
|
||||
-
|
||||
name: Docker meta
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
uses: docker/metadata-action@v6
|
||||
with:
|
||||
images: ${{ env.REGISTRY_SLUG || inputs.slug }}
|
||||
tags: |
|
||||
|
||||
4
.github/workflows/ci.yml
vendored
4
.github/workflows/ci.yml
vendored
@@ -220,7 +220,7 @@ jobs:
|
||||
-
|
||||
name: Docker meta
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
uses: docker/metadata-action@v6
|
||||
with:
|
||||
images: ${{ env.DOCKER_IMAGE }}
|
||||
tags: |
|
||||
@@ -1219,7 +1219,7 @@ jobs:
|
||||
-
|
||||
name: Docker meta
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
uses: docker/metadata-action@v6
|
||||
with:
|
||||
images: ${{ env.DOCKER_IMAGE }}
|
||||
tags: |
|
||||
|
||||
2
.github/workflows/test.yml
vendored
2
.github/workflows/test.yml
vendored
@@ -20,7 +20,7 @@ jobs:
|
||||
uses: actions/checkout@v6
|
||||
-
|
||||
name: Test
|
||||
uses: docker/bake-action@v6
|
||||
uses: docker/bake-action@v7
|
||||
with:
|
||||
source: .
|
||||
targets: test
|
||||
|
||||
4
.github/workflows/update-dist.yml
vendored
4
.github/workflows/update-dist.yml
vendored
@@ -14,7 +14,7 @@ jobs:
|
||||
-
|
||||
name: GitHub auth token from GitHub App
|
||||
id: docker-read-app
|
||||
uses: actions/create-github-app-token@v2
|
||||
uses: actions/create-github-app-token@v3
|
||||
with:
|
||||
app-id: ${{ secrets.GHACTIONS_REPO_WRITE_APP_ID }}
|
||||
private-key: ${{ secrets.GHACTIONS_REPO_WRITE_APP_PRIVATE_KEY }}
|
||||
@@ -28,7 +28,7 @@ jobs:
|
||||
token: ${{ steps.docker-read-app.outputs.token || github.token }}
|
||||
-
|
||||
name: Build
|
||||
uses: docker/bake-action@v6
|
||||
uses: docker/bake-action@v7
|
||||
with:
|
||||
source: .
|
||||
targets: build
|
||||
|
||||
10
.github/workflows/validate.yml
vendored
10
.github/workflows/validate.yml
vendored
@@ -15,15 +15,15 @@ jobs:
|
||||
prepare:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
targets: ${{ steps.generate.outputs.targets }}
|
||||
matrix: ${{ steps.generate.outputs.matrix }}
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
-
|
||||
name: List targets
|
||||
name: Generate matrix
|
||||
id: generate
|
||||
uses: docker/bake-action/subaction/list-targets@v6
|
||||
uses: docker/bake-action/subaction/matrix@v7
|
||||
with:
|
||||
target: validate
|
||||
|
||||
@@ -34,10 +34,10 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
target: ${{ fromJson(needs.prepare.outputs.targets) }}
|
||||
include: ${{ fromJson(needs.prepare.outputs.matrix) }}
|
||||
steps:
|
||||
-
|
||||
name: Validate
|
||||
uses: docker/bake-action@v6
|
||||
uses: docker/bake-action@v7
|
||||
with:
|
||||
targets: ${{ matrix.target }}
|
||||
|
||||
22
README.md
22
README.md
@@ -62,19 +62,19 @@ jobs:
|
||||
steps:
|
||||
-
|
||||
name: Login to Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
uses: docker/login-action@v4
|
||||
with:
|
||||
username: ${{ vars.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
-
|
||||
name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
uses: docker/setup-qemu-action@v4
|
||||
-
|
||||
name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
uses: docker/setup-buildx-action@v4
|
||||
-
|
||||
name: Build and push
|
||||
uses: docker/build-push-action@v6
|
||||
uses: docker/build-push-action@v7
|
||||
with:
|
||||
push: true
|
||||
tags: user/app:latest
|
||||
@@ -94,7 +94,7 @@ to the default Git context:
|
||||
```yaml
|
||||
-
|
||||
name: Build and push
|
||||
uses: docker/build-push-action@v6
|
||||
uses: docker/build-push-action@v7
|
||||
with:
|
||||
context: "{{defaultContext}}:mysubdir"
|
||||
push: true
|
||||
@@ -109,7 +109,7 @@ named `GIT_AUTH_TOKEN` to be able to authenticate against it with Buildx:
|
||||
```yaml
|
||||
-
|
||||
name: Build and push
|
||||
uses: docker/build-push-action@v6
|
||||
uses: docker/build-push-action@v7
|
||||
with:
|
||||
push: true
|
||||
tags: user/app:latest
|
||||
@@ -131,22 +131,22 @@ jobs:
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v5
|
||||
uses: actions/checkout@v6
|
||||
-
|
||||
name: Login to Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
uses: docker/login-action@v4
|
||||
with:
|
||||
username: ${{ vars.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
-
|
||||
name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
uses: docker/setup-qemu-action@v4
|
||||
-
|
||||
name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
uses: docker/setup-buildx-action@v4
|
||||
-
|
||||
name: Build and push
|
||||
uses: docker/build-push-action@v6
|
||||
uses: docker/build-push-action@v7
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
# Troubleshooting
|
||||
|
||||
* [Cannot push to a registry](#cannot-push-to-a-registry)
|
||||
* [BuildKit container logs](#buildkit-container-logs)
|
||||
* [With containerd](#with-containerd)
|
||||
* [`repository name must be lowercase`](#repository-name-must-be-lowercase)
|
||||
|
||||
## Cannot push to a registry
|
||||
@@ -21,59 +19,9 @@ These issues are not directly related to this action but are rather linked to
|
||||
you're pushing your image. The quality of error message depends on the registry
|
||||
and are usually not very informative.
|
||||
|
||||
### BuildKit container logs
|
||||
|
||||
To help you solve this, you have to [enable debugging in the setup-buildx](https://github.com/docker/setup-buildx-action#buildkit-container-logs)
|
||||
action step and attach BuildKit container logs to your issue.
|
||||
|
||||
### With containerd
|
||||
|
||||
Next you can test pushing with [containerd action](https://github.com/crazy-max/ghaction-setup-containerd)
|
||||
using the following workflow. If it works then open an issue on [BuildKit](https://github.com/moby/buildkit)
|
||||
repository.
|
||||
|
||||
```yaml
|
||||
name: containerd
|
||||
|
||||
on:
|
||||
push:
|
||||
|
||||
jobs:
|
||||
containerd:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
-
|
||||
name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
-
|
||||
name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
with:
|
||||
buildkitd-flags: --debug
|
||||
-
|
||||
name: Set up containerd
|
||||
uses: crazy-max/ghaction-setup-containerd@v2
|
||||
-
|
||||
name: Build Docker image
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
platforms: linux/amd64,linux/arm64
|
||||
tags: docker.io/user/app:latest
|
||||
outputs: type=oci,dest=/tmp/image.tar
|
||||
-
|
||||
name: Import image in containerd
|
||||
run: |
|
||||
sudo ctr i import --base-name docker.io/user/app --digests --all-platforms /tmp/image.tar
|
||||
-
|
||||
name: Push image with containerd
|
||||
run: |
|
||||
sudo ctr --debug i push --user "${{ secrets.DOCKER_USERNAME }}:${{ secrets.DOCKER_PASSWORD }}" docker.io/user/app:latest
|
||||
```
|
||||
|
||||
## `repository name must be lowercase`
|
||||
|
||||
You may encounter this issue if you're using `github.repository` as a repo slug
|
||||
@@ -105,15 +53,14 @@ to generate sanitized tags:
|
||||
```yaml
|
||||
- name: Docker meta
|
||||
id: meta
|
||||
uses: docker/metadata-action@v4
|
||||
uses: docker/metadata-action@v6
|
||||
with:
|
||||
images: ghcr.io/${{ github.repository }}
|
||||
tags: latest
|
||||
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v6
|
||||
uses: docker/build-push-action@v7
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
```
|
||||
@@ -122,16 +69,15 @@ Or a dedicated step to sanitize the slug:
|
||||
|
||||
```yaml
|
||||
- name: Sanitize repo slug
|
||||
uses: actions/github-script@v6
|
||||
uses: actions/github-script@v8
|
||||
id: repo_slug
|
||||
with:
|
||||
result-encoding: string
|
||||
script: return 'ghcr.io/${{ github.repository }}'.toLowerCase()
|
||||
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v6
|
||||
uses: docker/build-push-action@v7
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
tags: ${{ steps.repo_slug.outputs.result }}:latest
|
||||
```
|
||||
|
||||
30
dist/index.js
generated
vendored
30
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
91
yarn.lock
91
yarn.lock
@@ -1831,6 +1831,15 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"brace-expansion@npm:^2.0.2":
|
||||
version: 2.0.2
|
||||
resolution: "brace-expansion@npm:2.0.2"
|
||||
dependencies:
|
||||
balanced-match: "npm:^1.0.0"
|
||||
checksum: 10/01dff195e3646bc4b0d27b63d9bab84d2ebc06121ff5013ad6e5356daa5a9d6b60fa26cf73c74797f2dc3fbec112af13578d51f75228c1112b26c790a87b0488
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"brace-expansion@npm:^5.0.2":
|
||||
version: 5.0.4
|
||||
resolution: "brace-expansion@npm:5.0.4"
|
||||
@@ -2521,22 +2530,25 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"fast-xml-builder@npm:^1.0.0":
|
||||
version: 1.0.0
|
||||
resolution: "fast-xml-builder@npm:1.0.0"
|
||||
checksum: 10/06c04d80545e5c9f4d1d6cca00567b5cc09953a92c6328fa48cfb4d7f42630313b8c2bb62e9cb81accee7bb5e1c5312fcae06c3d20dbe52d969a5938233316da
|
||||
"fast-xml-builder@npm:^1.1.4":
|
||||
version: 1.1.4
|
||||
resolution: "fast-xml-builder@npm:1.1.4"
|
||||
dependencies:
|
||||
path-expression-matcher: "npm:^1.1.3"
|
||||
checksum: 10/32937866aaf5a90e69d1f4ee6e15e875248d5b5d2afd70277e9e8323074de4980cef24575a591b8e43c29f405d5f12377b3bad3842dc412b0c5c17a3eaee4b6b
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"fast-xml-parser@npm:^5.0.7":
|
||||
version: 5.4.2
|
||||
resolution: "fast-xml-parser@npm:5.4.2"
|
||||
version: 5.5.6
|
||||
resolution: "fast-xml-parser@npm:5.5.6"
|
||||
dependencies:
|
||||
fast-xml-builder: "npm:^1.0.0"
|
||||
fast-xml-builder: "npm:^1.1.4"
|
||||
path-expression-matcher: "npm:^1.1.3"
|
||||
strnum: "npm:^2.1.2"
|
||||
bin:
|
||||
fxparser: src/cli/cli.js
|
||||
checksum: 10/12585d5dd77113411d01cf41818cfecbbaf8f3d9e8448b1c35f50a7eb51205408bc8db27af5733173a77f96f72d7e121d9e675674f71334569157c77845aba39
|
||||
checksum: 10/91a42a0cf99c83b0e721ceef9c189509e96c91c1875901c6ce6017f78ad25284f646a77a541e96ee45a15c2f13b7780d090c906c3ec3f262db03e7feb1e62315
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
@@ -2645,17 +2657,18 @@ __metadata:
|
||||
linkType: hard
|
||||
|
||||
"glob@npm:^10.0.0, glob@npm:^10.2.2, glob@npm:^10.3.10":
|
||||
version: 10.3.12
|
||||
resolution: "glob@npm:10.3.12"
|
||||
version: 10.5.0
|
||||
resolution: "glob@npm:10.5.0"
|
||||
dependencies:
|
||||
foreground-child: "npm:^3.1.0"
|
||||
jackspeak: "npm:^2.3.6"
|
||||
minimatch: "npm:^9.0.1"
|
||||
minipass: "npm:^7.0.4"
|
||||
path-scurry: "npm:^1.10.2"
|
||||
jackspeak: "npm:^3.1.2"
|
||||
minimatch: "npm:^9.0.4"
|
||||
minipass: "npm:^7.1.2"
|
||||
package-json-from-dist: "npm:^1.0.0"
|
||||
path-scurry: "npm:^1.11.1"
|
||||
bin:
|
||||
glob: dist/esm/bin.mjs
|
||||
checksum: 10/9e8186abc22dc824b5dd86cefd8e6b5621a72d1be7f68bacc0fd681e8c162ec5546660a6ec0553d6a74757a585e655956c7f8f1a6d24570e8d865c307323d178
|
||||
checksum: 10/ab3bccfefcc0afaedbd1f480cd0c4a2c0e322eb3f0aa7ceaa31b3f00b825069f17cf0f1fc8b6f256795074b903f37c0ade37ddda6a176aa57f1c2bbfe7240653
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
@@ -2983,16 +2996,16 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"jackspeak@npm:^2.3.6":
|
||||
version: 2.3.6
|
||||
resolution: "jackspeak@npm:2.3.6"
|
||||
"jackspeak@npm:^3.1.2":
|
||||
version: 3.4.3
|
||||
resolution: "jackspeak@npm:3.4.3"
|
||||
dependencies:
|
||||
"@isaacs/cliui": "npm:^8.0.2"
|
||||
"@pkgjs/parseargs": "npm:^0.11.0"
|
||||
dependenciesMeta:
|
||||
"@pkgjs/parseargs":
|
||||
optional: true
|
||||
checksum: 10/6e6490d676af8c94a7b5b29b8fd5629f21346911ebe2e32931c2a54210134408171c24cee1a109df2ec19894ad04a429402a8438cbf5cc2794585d35428ace76
|
||||
checksum: 10/96f8786eaab98e4bf5b2a5d6d9588ea46c4d06bbc4f2eb861fdd7b6b182b16f71d8a70e79820f335d52653b16d4843b29dd9cdcf38ae80406756db9199497cf3
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
@@ -3241,12 +3254,12 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"minimatch@npm:^9.0.1":
|
||||
version: 9.0.4
|
||||
resolution: "minimatch@npm:9.0.4"
|
||||
"minimatch@npm:^9.0.4":
|
||||
version: 9.0.9
|
||||
resolution: "minimatch@npm:9.0.9"
|
||||
dependencies:
|
||||
brace-expansion: "npm:^2.0.1"
|
||||
checksum: 10/4cdc18d112b164084513e890d6323370db14c22249d536ad1854539577a895e690a27513dc346392f61a4a50afbbd8abc88f3f25558bfbbbb862cd56508b20f5
|
||||
brace-expansion: "npm:^2.0.2"
|
||||
checksum: 10/b91fad937deaffb68a45a2cb731ff3cff1c3baf9b6469c879477ed16f15c8f4ce39d63a3f75c2455107c2fdff0f3ab597d97dc09e2e93b883aafcf926ef0c8f9
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
@@ -3355,7 +3368,7 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"minipass@npm:^5.0.0 || ^6.0.2 || ^7.0.0, minipass@npm:^7.0.4":
|
||||
"minipass@npm:^5.0.0 || ^6.0.2 || ^7.0.0":
|
||||
version: 7.0.4
|
||||
resolution: "minipass@npm:7.0.4"
|
||||
checksum: 10/e864bd02ceb5e0707696d58f7ce3a0b89233f0d686ef0d447a66db705c0846a8dc6f34865cd85256c1472ff623665f616b90b8ff58058b2ad996c5de747d2d18
|
||||
@@ -3568,6 +3581,13 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"package-json-from-dist@npm:^1.0.0":
|
||||
version: 1.0.1
|
||||
resolution: "package-json-from-dist@npm:1.0.1"
|
||||
checksum: 10/58ee9538f2f762988433da00e26acc788036914d57c71c246bf0be1b60cdbd77dd60b6a3e1a30465f0b248aeb80079e0b34cb6050b1dfa18c06953bb1cbc7602
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"pako@npm:~0.2.0":
|
||||
version: 0.2.9
|
||||
resolution: "pako@npm:0.2.9"
|
||||
@@ -3591,6 +3611,13 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"path-expression-matcher@npm:^1.1.3":
|
||||
version: 1.1.3
|
||||
resolution: "path-expression-matcher@npm:1.1.3"
|
||||
checksum: 10/9a607d0bf9807cf86b0a29fb4263f0c00285c13bedafb6ad3efc8bc87ae878da2faf657a9138ac918726cb19f147235a0ca695aec3e4ea1ee04641b6520e6c9e
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"path-key@npm:^3.1.0":
|
||||
version: 3.1.1
|
||||
resolution: "path-key@npm:3.1.1"
|
||||
@@ -3598,13 +3625,13 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"path-scurry@npm:^1.10.2":
|
||||
version: 1.10.2
|
||||
resolution: "path-scurry@npm:1.10.2"
|
||||
"path-scurry@npm:^1.11.1":
|
||||
version: 1.11.1
|
||||
resolution: "path-scurry@npm:1.11.1"
|
||||
dependencies:
|
||||
lru-cache: "npm:^10.2.0"
|
||||
minipass: "npm:^5.0.0 || ^6.0.2 || ^7.0.0"
|
||||
checksum: 10/a2bbbe8dc284c49dd9be78ca25f3a8b89300e0acc24a77e6c74824d353ef50efbf163e64a69f4330b301afca42d0e2229be0560d6d616ac4e99d48b4062016b1
|
||||
checksum: 10/5e8845c159261adda6f09814d7725683257fcc85a18f329880ab4d7cc1d12830967eae5d5894e453f341710d5484b8fdbbd4d75181b4d6e1eb2f4dc7aeadc434
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
@@ -4402,9 +4429,9 @@ __metadata:
|
||||
linkType: hard
|
||||
|
||||
"undici@npm:^6.23.0":
|
||||
version: 6.23.0
|
||||
resolution: "undici@npm:6.23.0"
|
||||
checksum: 10/56950995e7b628e62c996430445d17995ca9b70f6f2afe760a63da54205660d968bd08f0741b6f4fb008f40aa35c69cce979cd96ced399585d8c897a76a4f1d1
|
||||
version: 6.24.1
|
||||
resolution: "undici@npm:6.24.1"
|
||||
checksum: 10/4f84e6045520eef9ba8eabb96360b50c759f59905c1703b12187c2dbcc6d1584c5d7ecddeb45b0ed6cac84ca2d132b21bfd8a38f77fa30378b1ac5d2ae390fd9
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
|
||||
Reference in New Issue
Block a user