Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when pushing image to github #115

Closed
dirodriguezm opened this issue Sep 9, 2020 · 2 comments
Closed

Error when pushing image to github #115

dirodriguezm opened this issue Sep 9, 2020 · 2 comments

Comments

@dirodriguezm
Copy link

Behaviour

Steps to reproduce this issue

  1. Create gh workflow file
  2. Push to repo and wait for action to finish

Expected behaviour

It shoud publish the image

Actual behaviour

An error shows at the very end of the process

Configuration

  • Repository URL (if public): not public :(
  • Build URL (if public): not public
name: build_image
on: [push]
jobs:
  push_to_registry:
    name: Push Docker image to GitHub Packages
    runs-on: ubuntu-latest
    steps:
      - name: Check out the repo
        uses: actions/checkout@v2
      - name: Prepare
        id: prep
        run: |
          DOCKER_IMAGE=ghcr.io/org-name/repo-name/image-name
          VERSION=latest
          if [[ $GITHUB_REF == refs/tags/* ]]; then
            VERSION=${GITHUB_REF#refs/tags/v}
          fi
          TAGS="${DOCKER_IMAGE}:${VERSION}"
          if [[ $VERSION =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then
            TAGS="$TAGS,${DOCKER_IMAGE}:latest"
          fi
          echo ::set-output name=tags::${TAGS}
      - name: Set up QEMU
        uses: docker/setup-qemu-action@v1
      - name: Set up Docker Buildx
        uses: docker/setup-buildx-action@v1
      - name: Login to GitHub Packages Docker Registry
        uses: docker/login-action@v1
        with:
          registry: ghcr.io
          username: ${{ github.repository_owner }}
          password: ${{ secrets.ACCESS_TOKEN }}
      - name: Push to GitHub Packages
        uses: docker/build-push-action@v2
        with:
          context: .
          file: ./Dockerfile
          push: true
          tags: ${{ steps.prep.outputs.tags }}

Logs

This is the command generated
/usr/bin/docker buildx build --tag ghcr.io/org/repo/img:latest --iidfile /tmp/docker-build-push-IWJ2p2/iidfile --file ./Dockerfile --push .
And this is the error after building the image

#12 exporting to image
#12 exporting layers
#12 exporting layers 124.7s done
#12 exporting manifest sha256:c397e9e4e7b9623d3a0a5a9ff3514cbbf6042c143140473fa896575af15d8015 done
#12 exporting config sha256:ce7590506aa8d1d4268d742e264cbec225a2ee39b05f0d75886727dc931e3904 done
#12 pushing layers
#12 pushing layers 325.0s done
#12 ERROR: failed commit on ref "layer-sha256:7677da09ac2b6576557eb8a144ac2e9a3d062b83a59dc44cc2ff79d26d783a9e": no response
------
 > exporting to image:
------
failed to solve: rpc error: code = Unknown desc = failed commit on ref "layer-sha256:7677da09ac2b6576557eb8a144ac2e9a3d062b83a59dc44cc2ff79d26d783a9e": no response
##[error]The process '/usr/bin/docker' failed with exit code 1

This is probably not a bug but just me doing something wrong, but can't figure out what part. Please any help is appreciated.

Thanks

@crazy-max
Copy link
Member

crazy-max commented Sep 9, 2020

Hi @dirodriguezm,

With GitHub Container Registry you can only have a single namespace (user or org) compared to GitHub Package Registry. So in your case I think you can't use ghcr.io/org/repo/img:latest tag. Try with ghcr.io/org/repo:latest instead.

@dirodriguezm
Copy link
Author

Thanks, that was it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants