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

push to hub.docker.com fails with denied: requested access to the resource is denied #88

Closed
bastelfreak opened this issue Aug 12, 2020 · 7 comments
Milestone

Comments

@bastelfreak
Copy link

bastelfreak commented Aug 12, 2020

Hi!
thanks for the awesome action! I added it to my workflow on https://github.com/voxpupuli/vox-pupuli-tasks

name: Ruby

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

jobs:
  test:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v2
    - name: Set up Ruby
    # To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
    # change this to (see https://github.com/ruby/setup-ruby#versioning):
    # uses: ruby/setup-ruby@v1
      uses: ruby/setup-ruby@ec106b438a1ff6ff109590de34ddc62c540232e0
      with:
        ruby-version: 2.7
    - uses: actions/cache@v2
      with:
        path: vendor/bundle
        key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
        restore-keys: |
          ${{ runner.os }}-gems-
    - name: Install dependencies
      run: |
        bundle config set path vendor/bundle
        bundle config set jobs $(nproc)
        bundle config set without development
        bundle install
    - name: Run tests
      run: bundle exec rake rubocop
    - name: Build and push Docker images
      uses: docker/build-push-action@v1
      with:
        username: ${{ secrets.DOCKER_USERNAME }}
        password: ${{ secrets.DOCKER_PASSWORD }}
        repository: voxpupuli/vox-pupuli-tasks
        add_git_labels: true
        tags: latest
        tag_with_ref: true
        tag_with_sha: true
    - name: Build and push Docker images
      uses: docker/build-push-action@v1
      with:
        username: ${{ secrets.DOCKER_USERNAME }}
        password: ${{ secrets.DOCKER_PASSWORD }}
        repository: voxpupuli/vox-pupuli-tasks
        add_git_labels: true
        tag_with_ref: true
        push: ${{ startsWith(github.ref, 'refs/tags/') }}

I also published a few docker modules with this. Since a few days I get the following errormessage:

Successfully built 65ffb4a2ea6a
Successfully tagged voxpupuli/vox-pupuli-tasks:latest
Successfully tagged voxpupuli/vox-pupuli-tasks:pr-217-merge
Successfully tagged voxpupuli/vox-pupuli-tasks:sha-0612700
Pushing image [voxpupuli/vox-pupuli-tasks:latest voxpupuli/vox-pupuli-tasks:pr-217-merge voxpupuli/vox-pupuli-tasks:sha-0612700]
The push refers to repository [docker.io/voxpupuli/vox-pupuli-tasks]
d0d252682376: Preparing
cb1d850665a1: Preparing
3da0bf188cbd: Preparing
97f83abe5a46: Preparing
91cd5a8e58ae: Preparing
fd74c6bcef3b: Preparing
9c6bf071bef9: Preparing
b84c9316c1db: Preparing
1620e857daea: Preparing
93a2bfafa84f: Preparing
54f362ba164c: Preparing
c4b1ff92c516: Preparing
446d8e2016ac: Preparing
50644c29ef5a: Preparing
fd74c6bcef3b: Waiting
9c6bf071bef9: Waiting
b84c9316c1db: Waiting
1fa5cdcb4f03: Waiting
0262166ecd22: Waiting
1bb9a3658531: Waiting
1620e857daea: Waiting
93a2bfafa84f: Waiting
54f362ba164c: Waiting
c4b1ff92c516: Waiting
446d8e2016ac: Waiting
50644c29ef5a: Waiting
denied: requested access to the resource is denied
exit status 1
Error: exit status 1
Usage:
  github-actions build-push [flags]

Flags:
  -h, --help   help for build-push

I'm not 100% sure what it means. Are the credentials wrong? I built a docker image locally and pushed it with my credentials and that worked. I set the same as github secrets for DOCKER_USERNAME and DOCKER_PASSWORD.

@osterman
Copy link

osterman commented Sep 8, 2020

We were also using this GitHub action everywhere for a couple of months. Now it has started erroring with the same message.

denied: requested access to the resource is denied

As a precaution, we rotated keys and tried again. Same outcome.

@osterman
Copy link

osterman commented Sep 8, 2020

I suspect it's related to #92.

image

@osterman
Copy link

osterman commented Sep 8, 2020

We switched to uses: docker/build-push-action@v2 and everything started working again.

@crazy-max
Copy link
Member

@osterman,

We switched to uses: docker/build-push-action@v2 and everything started working again.

Inputs have changed in v2 (not GA for now). See Usage section and also this workflow as an example.

@crazy-max
Copy link
Member

Version 2 has been merged to the main branch and is therefore available via uses: docker/build-push-action@v2 (mutable tag).

As a reminder, this new version changes drastically and works with 3 new actions (login, setup-buildx and setup-qemu) that we have created. Many usage examples have been added to handle most use cases.

And it should fix this current issue. Don't hesitate if you have any questions.

bastelfreak added a commit to bastelfreak/vox-pupuli-tasks that referenced this issue Sep 27, 2020
tl;dr v1 is broken and poorly documented. We raised those concerns via
an issue. That should be fixed in v2: docker/build-push-action#88 (comment)
bastelfreak added a commit to bastelfreak/vox-pupuli-tasks that referenced this issue Sep 27, 2020
tl;dr v1 is broken and poorly documented. We raised those concerns via
an issue. That should be fixed in v2: docker/build-push-action#88 (comment)
juacompe referenced this issue in poorprogrammer/cfo Mar 21, 2022
- still login fail when push images to dockerhub
- trying using docker/build-push-action@v2

ref: https://github.com/docker/build-push-action/issues/88\#issuecomment-688992823
kstsai referenced this issue in kstsai/terraform-provider-caep May 23, 2022
@guptadikshant
Copy link

Hello Everyone,

Can anyone please provide any solution here. i tried many options but this access denied issue is not resolved.

Can anyone please help ?

Thanks,
Dikshant

@nileshsahitya9
Copy link

nileshsahitya9 commented Dec 21, 2022

For building the image just use this command

docker build -t {your docker username}/{name_of_the_image} .

for pushing the image

docker push{ your docker username}/{name_of_the_image}

Docker uses public repo if you don't specify the username

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

No branches or pull requests

5 participants