Description: When pulling docker images from a virtual repository with an anonymous user the docker client throws an error message saying that the manifest for the image is not found instead of an unauthorized message. However, If we try pulling the same image via local repository then a correct error message (unauthorized) will be displayed.
Steps to reproduce:
1. Enable Anonymous access for the Artifactory and the Anonymous user does not have any permission to the docker repository.
2. Create a docker local repository.
3. Create a docker virtual repository and add the above local repository in it.
4. Push a Docker image to the docker local repository via a docker virtual repository with the privileged user.
5. Perform docker logout.
6. Try to pull the image from the Anonymous user via the local repository and could see the below correct error message.
7. Try to pull the image from the Anonymous user via virtual repository and could see the below Incorrect error message.
Request log :
Expected result: Even when we try to pull the image via a docker virtual repository using an anonymous user we should get an unauthorized error message.
Impact: Currently the error message from the virtual repo is confusing. If the end-users do not know what is local/virtual repo in the Artifactory and It will cost them a lot of time to troubleshoot the issue. Artifactory should tell the docker client that it needs authentication in that case.