mirror of
https://gh-proxy.com/https://github.com/docker/build-push-action
synced 2026-03-22 12:18:49 +08:00
Compare commits
2 Commits
eb6512707b
...
dependabot
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9debfbd464 | ||
|
|
721f9a6d64 |
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@v6
|
||||
uses: docker/metadata-action@v5
|
||||
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@v6
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: ${{ env.DOCKER_IMAGE }}
|
||||
tags: |
|
||||
@@ -1219,7 +1219,7 @@ jobs:
|
||||
-
|
||||
name: Docker meta
|
||||
id: meta
|
||||
uses: docker/metadata-action@v6
|
||||
uses: docker/metadata-action@v5
|
||||
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@v7
|
||||
uses: docker/bake-action@v6
|
||||
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@v3
|
||||
uses: actions/create-github-app-token@v2
|
||||
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@v7
|
||||
uses: docker/bake-action@v6
|
||||
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:
|
||||
matrix: ${{ steps.generate.outputs.matrix }}
|
||||
targets: ${{ steps.generate.outputs.targets }}
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
-
|
||||
name: Generate matrix
|
||||
name: List targets
|
||||
id: generate
|
||||
uses: docker/bake-action/subaction/matrix@v7
|
||||
uses: docker/bake-action/subaction/list-targets@v6
|
||||
with:
|
||||
target: validate
|
||||
|
||||
@@ -34,10 +34,10 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include: ${{ fromJson(needs.prepare.outputs.matrix) }}
|
||||
target: ${{ fromJson(needs.prepare.outputs.targets) }}
|
||||
steps:
|
||||
-
|
||||
name: Validate
|
||||
uses: docker/bake-action@v7
|
||||
uses: docker/bake-action@v6
|
||||
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@v4
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ vars.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
-
|
||||
name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v4
|
||||
uses: docker/setup-qemu-action@v3
|
||||
-
|
||||
name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v4
|
||||
uses: docker/setup-buildx-action@v3
|
||||
-
|
||||
name: Build and push
|
||||
uses: docker/build-push-action@v7
|
||||
uses: docker/build-push-action@v6
|
||||
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@v7
|
||||
uses: docker/build-push-action@v6
|
||||
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@v7
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
push: true
|
||||
tags: user/app:latest
|
||||
@@ -131,22 +131,22 @@ jobs:
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
uses: actions/checkout@v5
|
||||
-
|
||||
name: Login to Docker Hub
|
||||
uses: docker/login-action@v4
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ vars.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
-
|
||||
name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v4
|
||||
uses: docker/setup-qemu-action@v3
|
||||
-
|
||||
name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v4
|
||||
uses: docker/setup-buildx-action@v3
|
||||
-
|
||||
name: Build and push
|
||||
uses: docker/build-push-action@v7
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
# 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
|
||||
@@ -19,9 +21,59 @@ 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
|
||||
@@ -53,14 +105,15 @@ to generate sanitized tags:
|
||||
```yaml
|
||||
- name: Docker meta
|
||||
id: meta
|
||||
uses: docker/metadata-action@v6
|
||||
uses: docker/metadata-action@v4
|
||||
with:
|
||||
images: ghcr.io/${{ github.repository }}
|
||||
tags: latest
|
||||
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v7
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
```
|
||||
@@ -69,15 +122,16 @@ Or a dedicated step to sanitize the slug:
|
||||
|
||||
```yaml
|
||||
- name: Sanitize repo slug
|
||||
uses: actions/github-script@v8
|
||||
uses: actions/github-script@v6
|
||||
id: repo_slug
|
||||
with:
|
||||
result-encoding: string
|
||||
script: return 'ghcr.io/${{ github.repository }}'.toLowerCase()
|
||||
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v7
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
tags: ${{ steps.repo_slug.outputs.result }}:latest
|
||||
```
|
||||
|
||||
2
dist/index.js
generated
vendored
2
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
@@ -24,7 +24,7 @@
|
||||
"packageManager": "yarn@4.9.2",
|
||||
"dependencies": {
|
||||
"@actions/core": "^3.0.0",
|
||||
"@docker/actions-toolkit": "0.79.0",
|
||||
"@docker/actions-toolkit": "0.80.0",
|
||||
"handlebars": "^4.7.7"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
10
yarn.lock
10
yarn.lock
@@ -367,9 +367,9 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@docker/actions-toolkit@npm:0.79.0":
|
||||
version: 0.79.0
|
||||
resolution: "@docker/actions-toolkit@npm:0.79.0"
|
||||
"@docker/actions-toolkit@npm:0.80.0":
|
||||
version: 0.80.0
|
||||
resolution: "@docker/actions-toolkit@npm:0.80.0"
|
||||
dependencies:
|
||||
"@actions/artifact": "npm:^6.2.0"
|
||||
"@actions/cache": "npm:^6.0.0"
|
||||
@@ -393,7 +393,7 @@ __metadata:
|
||||
semver: "npm:^7.7.4"
|
||||
tar-stream: "npm:^3.1.7"
|
||||
tmp: "npm:^0.2.5"
|
||||
checksum: 10/d64849ba49b2b59e2e93237a70be03fd7c43b1f7f01bac3f7557616ba5f59be785cb12a273bbb6a71c1e0d959f1bc6c673111b587c57bd2d6da105dcc500921a
|
||||
checksum: 10/cd805370b3ece50f42a391fc09a11588fc69ef3aac729c2002416402c13040cf43c63676554a5118243a2c09227d4d566baf8bf557a26291063e8278d35af819
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
@@ -2094,7 +2094,7 @@ __metadata:
|
||||
resolution: "docker-build-push@workspace:."
|
||||
dependencies:
|
||||
"@actions/core": "npm:^3.0.0"
|
||||
"@docker/actions-toolkit": "npm:0.79.0"
|
||||
"@docker/actions-toolkit": "npm:0.80.0"
|
||||
"@eslint/js": "npm:^9.39.3"
|
||||
"@types/node": "npm:^24.11.0"
|
||||
"@typescript-eslint/eslint-plugin": "npm:^8.56.1"
|
||||
|
||||
Reference in New Issue
Block a user