Image pull fails when pulled from a user-created project in Harbor
search cancel

Image pull fails when pulled from a user-created project in Harbor

book

Article ID: 316825

calendar_today

Updated On:

Products

Pivotal CloudFoundry Services 1.x

Issue/Introduction

Symptoms:
You see an error similar to the following when attempting to pull an image from a user-created project in Harbor:

rpc error: code = Unknown desc = Error response from daemon: pull access denied for harbor-registry/usercreatedproject/image:tag, repository does not exist or may require 'docker login'


Environment

VMware PKS 1.x

Cause

By default, when a project is created in Harbor it is created in "private" access mode. In this mode, a user would have to run docker login before pulling images under this project.

Resolution

If you want to allow only selected users to have pull access, you can grant access by authenticating that user to the Registry.

You can login to the Harbor registry by running a command similar to the following:

docker login <Registry name> -u username

Enter the password and then you will see a successful login message similar to the following:

========
WARNING! Your password will be stored unencrypted in /root/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store
 
Login Succeeded

========

If the Project has to be granted READ access to all the users, set the Access Level of the project to "Public".
When a project is set to public, anyone has read permission to the repositories under this project, and the user does not need to run docker login"before pulling images under this project.
For pushing the Images, the user has to run docker login to the registry and then authenticate successfully.