Get started with Artifact Registry
The Harness Artifact Registry module allows you to quickly and easily store your digital artifacts.
Getting started with Artifact Registry follows these steps:
- Create a registry
- Create an upstream proxy
- Connect the upstream proxy to the registry
- Use you registry
Prerequisite
Depending on your package manager, e.g. Docker, Helm or Maven, you may need to use its associated dependencies like the Docker CLI.
Create a registry
- Interactive guide
- Step-by-step
- Select + New Artifact Registry under the Registries tab.
- Select a registry type.
- Enter a Registry Name and, optionally, a Description or Labels.
tip
This registry name must start with a letter and can only contain lowercase alphanumerics,
_
,.
and-
- Select Create Registry.
Create an upstream proxy
An Upstream Proxy in an Artifact Registry is a configuration that enables the registry to retrieve artifacts from an external or remote registry. If a requested artifact is not available locally, the registry forwards the request to the upstream proxy to fetch it.
Upstream proxies are commonly used to manage dependencies. During a build, if an open-source dependency is not already cached in the upstream proxy, it will be fetched from a public repository. This ensures access to necessary dependencies while optimizing retrieval speed and reducing redundant downloads.
To create one, follow these steps:
- Interactive guide
- Step-by-step
-
Select the dropdown next to + New Artifact Registry, and then select Upstream Proxy.
-
Enter the Upstream Proxy Key. This is the identifier or name for the proxy within Harness and is chosen by you.
allowed charactersThis proxy key must start with a letter and can only contain lowercase alphanumerics,
_
,.
and-
-
For the source, e.g. Docker Hub.
-
Choose your Authentication method.
- In cases where you use public images, select Anonymous.
-
Select Create Upstream Proxy.
Connect the upstream proxy
After creating an upstream proxy, you need to set it in your artifact registry. To do so, follow these steps:
- Interactive guide
- Step-by-step
- In the registry we created above, select Configuration.
- Open the Advanced (Optional) dropdown menu.
- Select Configure Upstream.
- Under Available upstream proxies, you will see a list of available upstream proxies. Select as many as you would like.
- Under Selected proxies, you will see an ordered list of selected proxies for this registry. When the registry receives a request, the proxies will be queried in order from top to bottom.
- Click Save in the top right corner.
Use a registry
Next, use the registry we created. To do so, we will pull an artifact from the proxy, tag it, and add it to our registry.
- Interactive guide
- Step-by-step
- Click Setup Client.
- Select Generate Token to generate a token to use as your password when logging into your package e.g. Docker or Maven
- Follow the remained on-screen instruction by running the command in your terminal to pull an image and then push it to your registry.
When you pull an artifact, the system first checks the local registry. If the artifact is not found, it automatically queries the upstream proxy. The proxy then attempts to retrieve the artifact from the designated external source, if available. This process ensures seamless access to artifacts, even if they are not initially stored in the local registry.
Now, you should see the artifact appear in your docker registry as well as the Artifacts tab in the left navigation panel. That concludes the quick start guide! You should now have enough to get started with Artifact Registry.
See Also
To learn more go to: