JFROG ARTIFACTORY: How to Replicate Artifacts Across Sites and Resolve in Artifactory
JFROG ARTIFACTORY: How to Replicate Artifacts Across Sites and Resolve in Artifactory
Option #1
In addition to the usual benefits offered by remote repositories and smart remote repositories, there are several advantages of which you may not be aware. For example, you can configure a smart repository on Site B, which is pointing to a local repository on Site A.
Option #2
In this functional example, there are two sites, A and B. The idea is to push Docker artifacts to Site A, replicate them on Site B, and then pull the replicated Docker artifacts from Site B.
- On Artifactory Site B
- Create a local repository, named docker-local, and a virtual repository, named docker. You can also create a remote Docker registry named as docker-remote and add both the local and remote repositories to the virtual docker repository.
- On Artifactory Site A
- Create a local, remote, and virtual repositories named as docker-local, docker-remote and docker.
- On docker-local repo of site A, set up your replication to replicate artifacts to docker-local repo of site B.
- Push to Site A:
Follow the below steps to push the artifacts:
- docker login <site A artifactory server>
- docker tag <docker image id> <site A artifactory server>/docker/<docker image tag>
- docker push <site A artifactory server>/docker/<docker image tag>. For example:
- docker login siteA.com
- docker push siteA.com/docker/nginx
- docker tag c82521676580 siteA.com/docker/nginx
- The above replication will replicate the docker artifact to site B's 'docker-local' repo which you can pull from the virtual repo 'docker' in site B as following:
- docker login <site B artifactory server>
- docker pull <site B artifactory server>/docker/<docker image tag>. For example:
- docker login siteB.com
- docker pull siteB.com/docker/nginx
Published: Feb. 15, 2019
Last updated: Apr.23, 2021
Keywords: Docker Replication, Artifactory