build-push-action icon indicating copy to clipboard operation
build-push-action copied to clipboard

docker push to an image on docker hub via gitlab ci/cd giving "denied: requested access to the resource is denied"

Open bytehealer opened this issue 5 years ago • 3 comments

Hello Folks: I am trying to set up cicd pipeline. I have successfully build image and tagged it. My repo on docker hub is private. Whenever i am trying to push to docker hub it is giving "denied: requested access to the resource is denied" Stack trace from gitalb is below:

The push refers to repository [docker.io/myrepo/myimage-frontend-nginx]
5ef23ebecc6b: Preparing
a57fd3e3021d: Preparing
01e894db9460: Preparing
6c7de695ede3: Preparing
2f4accd375d9: Preparing
ffc9b21953f4: Preparing
ffc9b21953f4: Waiting
denied: requested access to the resource is denied

bytehealer avatar Feb 10 '21 03:02 bytehealer

@mannawar Please create a proper bug report.

crazy-max avatar Feb 10 '21 06:02 crazy-max

@crazy-max below fmore info on this:

Troubleshooting

Before sumbitting a bug report please read the Troubleshooting doc.

Behaviour

When trying to set up ci/cd in gitlab.

Steps to reproduce this issue

This id .gitlab-ci.yml file config variables: DOCKER_DRIVER: overlay DOCKER_HOST: tcp://docker:2375/ DOCKER_TLS_CERTDIR: "" docker-build-master:

Official docker image.

image: docker:18-git stage: build services: - docker:18-dind before_script: - docker info - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_TOKEN" $CI_REGISTRY script: - echo "Deploying Frontend..." - IMAGE_NAME="$CI_REGISTRY_REPO/$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME" - docker build --pull -t "$IMAGE_NAME" -f angular/Dockerfile . - docker push "$IMAGE_NAME" - echo "Frontend Deployment Complete! " only: - master

Expected behaviour

This should push to the docker hub private repo.

Tell us what should happen

Actual behaviour

Tell us what happens instead request access denied showing on gitlab terminal

Configuration

  • Repository URL (if public):
  • Build URL (if public):
# paste your YAML workflow file here and remove sensitive data

Logs

The push refers to repository [docker.io/user/repo/image-frontend-nginx]
c5ce8056bb7b: Preparing
86e25071a550: Preparing
8e89381bb9fb: Preparing
6c7de695ede3: Preparing
2f4accd375d9: Preparing
ffc9b21953f4: Preparing
ffc9b21953f4: Waiting
denied: requested access to the resource is denied
Cleaning up file based variables

Download the log file of your build and attach it to this issue.

bytehealer avatar Feb 10 '21 06:02 bytehealer

@mannawar That's not the right place to create an issue. This repo is about GitHub Actions for Docker, not Gitlab. I suggest to open a thread on Docker Community forums about your issue. Thanks.

crazy-max avatar Feb 10 '21 06:02 crazy-max