---
title: "Part II: Artifactory as a Caching Mechanism for Package Managers"
url: "https://jfrog.com/blog/part-ii-artifactory-as-a-caching-mechanism-for-package-managers/"
canonical: "https://jfrog.com/blog/part-ii-artifactory-as-a-caching-mechanism-for-package-managers/"
lang: "en-US"
type: "article"
description: "Your build failed again? Learn & get use cases to configure Artifactory as a remote repository for popular package managers and make your builds fast stable & secure"
date: "2020-02-12T11:20:33"
modified: "2021-08-24T18:22:42"
---
# Part II: Artifactory as a Caching Mechanism for Package Managers

[Blog Home](https://jfrog.com/blog/)

![Part II: Artifactory as a Caching Mechanism for Package Managers](https://speedmedia2.jfrog.com/08612fe1-9391-4cf3-ac1a-6dd49c36b276/jfrog.com/wp-content/uploads/2020/02/Artifactory-as-a-Caching-Mechanism-Part2-864x300-1.png)

#### **Note: This blog post was recently updated on August 18, 2021.**

In [our previous blog post](https://jfrog.com/blog/artifactory-as-a-caching-mechanism-for-package-managers/) we discussed the challenges with relying on external servers for downloading pre-build tools such as Curl, CLI, wget, Maven, Gradle, npm and others. We discussed how they can sometimes cause stability issues, also called “Environmental Issues”, that will break the build.

In this second part of the 2-part series, we’ll expand on the solution of using Artifactory [remote repositories](https://www.jfrog.com/confluence/display/RTF/Remote+Repositories), applying it for using [Homebrew](https://brew.sh/) to download and install Mac and Linux applications is simple, as well as [Yum](https://yum.baseurl.org/) and [Docker](https://hub.docker.com/).

## Use Case: Homebrew

Here’s how you can download Brew bottles using Artifactory.

_**Note**: Supported for Artifactory 6.9 and above, and Homebrew 3.2.7 and above._

### Step by step guide

#### Step 1: Configure Artifactory repository

Create a [remote Docker repository](https://www.jfrog.com/confluence/display/RTF/Remote+Repositories) in Artifactory:

*   Repository Key: _homebrew_
*   Url: https://ghcr.io

#### Step 2: Connect Homebrew to Artifactory

```
export HOMEBREW_ARTIFACT_DOMAIN=<artifactory-url>/homebrew
```

**For authenticated access:**

```
export HOMEBREW_DOCKER_REGISTRY_TOKEN=<artifactory-access-token>
```

Each _brew install_ command will now go through Artifactory’s cache.

## Use Case: Yum

Here’s how you can use an Artifactory remote [RPM repository](https://jfrog.com/integration/artifactory-rpm-repository/) to download your RPM packages using [Yum](https://yum.baseurl.org/).

### Step by step guide

#### Step 1: Configure Artifactory repository

Create a [remote RPM repository](https://www.jfrog.com/confluence/display/RTF/RPM+Repositories#RPMRepositories-RemoteRepositories) in Artifactory:

*   Repository Key: _yum_
*   Url: https://mirror.centos.org/centos/<version>/os/<architecture>
    *   Example: https://mirror.centos.org/centos/7.6.1810/os/x86\_64

#### Step 2: Create a file

```
/etc/yum.repos.d/artifactory
```

**File content for anonymous access:**

```
[artifactory]HERE
name=artifactory
baseurl=https://<artifactory-url>/yum
enabled=1
gpgcheck=0
```

**File content for authenticated access:**

```
[artifactory]
name=artifactory
baseurl=https://<artifactory-user:<artifactory-password>@<artifactory-url>/yum
enabled=1
gpgcheck=0
```

## Use Case: Docker

Here’s how you can use an Artifactory remote Docker repository to download your Docker images using [Docker CLI](https://docs.docker.com/engine/reference/commandline/cli/).

### Step by step guide

#### Step 1: Configure Artifactory repository

Create a [remote Docker repository](https://www.jfrog.com/confluence/display/RTF/Docker+Registry#DockerRegistry-RemoteDockerRepositories) in Artifactory:

*   Repository Key: _docker_
*   Url: [https://registry-1.docker.io/](https://registry-1.docker.io/)

#### Step 2: Login to Docker Registry

You can retrieve this command from the Artifactory using the [Set Me Up](https://www.jfrog.com/confluence/display/RTF/Docker+Registry#DockerRegistry-SetMeUp) button.

```
docker login <your docker domain>
```

#### Step 3: Docker Pull

```
docker pull <your docker domain>/<docker image>:<docker tag>
```

| As an alternative, you can also manage your Docker images using the free [JFrog Container Registry](https://jfrog.com/container-registry/). |
| --- |

Try these out for yourself!