ARTIFACTORY: How to configure the Docker remote repository to pull specific images

Muhammed Kashif
2021-09-01 20:07

In this article we will understand how to configure the docker remote repository to pull specific images using the include pattern. The purpose of this article is to understand that there could be some use cases wherein we need a specific remote repository for specific images/artifacts.

 

Below are the steps on configuring the same and here we will take an example of pulling just the “python” images from Dockerhub and restricting other images.

1. Create a docker registry to "https://registry-1.docker.io/" and use the include pattern "**/python/**" to achieve this,

User-added image

2. Make sure the include pattern only includes this "**/python/**" pattern as shown above and no other patterns.

3. Once setup, Pulling other images would fail as "Manifest not found" error,

$ docker pull myartifactory/docker-python/busybox
Using default tag: latest
Error response from daemon: manifest for myartifactory/docker-python/busybox:latest not found: manifest unknown: The named manifest is not known to the registry.
$ docker pull myartifactory/docker-python/nginx
Using default tag: latest
Error response from daemon: manifest for myartifactory/docker-python/nginx not found: manifest unknown: The named manifest is not known to the registry.

4. Pulling just the python image is successful,

$ docker pull myartifactory/docker-python/python
Using default tag: latest
latest: Pulling from docker-python/python
31dd5ebca5ef: Pull complete
3ed641c4ae98: Pull complete
bcd57146431e: Pull complete
ac34a4d7c330: Downloading ==================================> 35.41MB/51.83MB
3b0a7e6f20fb: Downloading =========> 36.34MB/192.2MB
75d93399dc4e: Download complete
28242c4c1c7e: Downloading ================================> 26.36MB/29.7MB
698b2a81f0a6: Waiting
e4cb0ad02465: Waiting

Similarly, if the use case is pull specific images, we can make use of the include pattern and add the pattern as “**/image-name/**”, this include pattern will make sure that the specified image-name is pulled from the remote source. 

Note: The same article can be referred with different package types wherein the use-case is to pull specific artifacts. Also, this KB article on include/exclude pattern explains in depth.