When encountering the "Unsupported Docker V2 repository request for 'repo_name'" error while pulling or pushing images from/to Artifactory, there are several potential causes and solutions:
1. Check the pull/push command: Make sure you are using the correct format for the pull/push command.
You should not include "/artifactory" in the push/pull command.
It should be something like:
docker pull artprod.mycompany/<DOCKER_REPOSITORY>:<DOCKER_TAG>
2. Verify Docker Registry API version: Ensure that you are using Docker Registry API v2, as older versions (such as v1) not supported by us.
3. Update Docker version: If you are using an older version of Docker, it might be attempting to interact with v1 registries. Consider upgrading to a newer version of Docker that supports v2 repositories.
4. Check repository existence: Verify that the repository you are trying to push/pull the image into/from exists in Artifactory. If the repository does not exist, create it before attempting to push/pull the image.
5. Review reverse proxy configuration: If you are using a reverse proxy, such as Nginx or Apache, ensure that you have the appropriate rewrite rules configured. For example:
Nginx:
rewrite ^/(v1|v2)/(.*) /api/docker/$repo/$1/$2;
Apache:
RewriteCond "%{REQUEST_URI}" "^/(v1|v2)/"
By considering these potential causes and applying the respective solutions, you should be able to resolve the "Unsupported Docker V2 repository request" error when working with Artifactory.