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