by 908B64B197 · 6y ago · 0 comments
Artifactory seems to have a pretty big chunk of this vertical. It supports a few different repository protocols, so it serves as a bit of a one-stop shop that survives technology changes.
Even ignoring download costs, a local cache (one of the functions of an artifactory) helps speed up those downloads and,with it, your builds. It probably also helps against getting blacklisted by code repositories.
An artifactory also automatically backs up any libraries you use. That protects against them disappearing from the internet.
As you get into CI/CD you start to notice that your upstream repo is occasionally down, because it’s getting in the way of some deadline.
I guess you could still fall back to the main package source if the local mirror is down.
1) set up a series of N docker registry mirrors in pull-through mode (https://docs.docker.com/registry/recipes/mirror/, it's as simple as "docker run --rm --name registry -d -p 5000:5000 -e REGISTRY_STORAGE_DELETE_ENABLED=true -e REGISTRY_PROXY_REMOTEURL=https://registry-1.docker.io -v /mnt/persistentdata/registry:/var/lib/registry registry")
2) expose them on the same domain name (multiple A records, loadbalancers, whatever you want)
3) set them as mirrors in each machine's docker daemon
In case one of your mirrors go down, take them out of the DNS/LB rotation. That's it.
It runs well, is easy to keep up and working and generally was awesome.