Search code examples
artifactoryalpine-linux

Setup Alpine mirror in Artifactory to keep packages available removed from official repositories


I'm using Artifactory as a docker registry. I have a few docker images based on Alpine Linux and its packages.

I pin the exact version of each Alpine package I install in these images because:

  • I want repeatable builds
  • I don't want applications running within these images to suddenly break because of a regression in a newer version of a package that was installed "behind the scenes" when building the image

I found out that Artifactory offers Alpine repositories.

By setting up a Alpine virtual repository containing a Alpine remote repository pointing to the official Alpine mirror, Artifactory should define a remote cache that should store the Alpine packages I install from within my images.

After that, I can configure my Alpine-based docker images to use Artifactory has the alpine package repository.

In this way, if a package I previously installed when building an image gets removed from the official Alpine repositories is removed, I should still be able to build the image, as it would resolve the package from the alpine remote cache in Artifactory.

Furthermore, does anyone know if it's possible to backup the remote-cache?


Solution

  • You need to store the cache somewhere in Artifactory so that if some files are deleted in the official Alpine repo you will still be able to use it thru the Artifactory? And to do so, I would recommend performing the copy of the files from the cache to the Alpine local repository and you can automate the things using the createcopy user plugin by copying from cache to local repository and integrate the local as well as the remote in the same virtual repository.