Create an Alpine Repository

Create an Alpine Repository

To install or host Alpine packages, creation of an Alpine repository is required. Check out Nexus Repository Management and Repository Types to learn more.

Alpine Proxy Repository

Use Nexus proxy repository when you want to download packages and centralize package caching of external dependencies. To learn more, check Proxy Repositories.

To create a new Alpine proxy repository, take the following steps:

  1. Navigate to SettingsRepositoryRepositories.

  2. Select the Create repository button.

  3. From the list of Recipes, select alpine (proxy).

  4. In the form that appears, complete the required fields.

  5. Configure Alpine signing settings as required by your repository setup. For more details, see Generate an Alpine Signing Key.

  6. Complete the additional fields for configurations you wish to add for creating your repository. Available configurations differ by repository format and type. See Configurable Repository Fields for more details.

  7. Select Create repository.

Alpine Hosted Repository

Use Nexus hosted repository when you want to publish and store your own internal artifacts and third party components, so they can be consumed via Nexus. To learn more, check Hosted Repositories.

To create a new Alpine hosted repository, take the following steps:

  1. Navigate to SettingsRepositoryRepositories.

  2. Select the Create repository button.

  3. From the list of Recipes, select alpine (hosted).

  4. In the form that appears, complete the required fields.

    • Repository Name, for example alpine-hosted
    • Blob store

Alpine Group Repository

Use Nexus group repository when you want to combine multiple other repositories (proxy, hosted, and other groups) and expose them through a single URL. To learn more, check Group Repositories.

To create a new Alpine group repository, take the following steps:

  1. Navigate to SettingsRepositoryRepositories.

  2. Select the Create repository button.

  3. From the list of Recipes, select alpine (group).

  4. In the form that appears, complete the required fields.

    • Repository Name, for example alpine-group
    • Blob store
    • Member repositories in the desired order

Generate an Alpine Signing Key

Use an RSA private key in PKCS#8 PEM format to sign Alpine repository metadata. Take the following steps to generate and rename the signing key:

  1. Generate the 2048-bit RSA key using the following command to save it directly to a file.
openssl genrsa 2048 | openssl pkcs8 -topk8 -nocrypt -out alpine-signing.key
  1. Extract the public key from the private key.
openssl rsa -in alpine-signing.key -pubout -out alpine-signing.pub
  1. Generate the public key filename. Alpine requires the public key to have a specific filename derived from your private key. The filename follows the pattern key-<hash>.rsa.pub.

Run the following code to generate the filename:

For Windows:

$l = Get-Content alpine-signing.key
$b = ($l[1..($l.Count-2)] -join '') -replace '\s',''
$h = -join ([Security.Cryptography.SHA256]::Create().ComputeHash([Text.Encoding]::ASCII.GetBytes($b)) | ForEach-Object { $_.ToString('x2') })
"key-$($h.Substring(56,8))"

For Linux or macOS:

sed '1d;$d' alpine-signing.key | tr -d '\n\r ' | sha256sum | awk '{print "key-" substr($1, 57, 8)}'

For macOS (using shasum):

sed '1d;$d' alpine-signing.key | tr -d '\n\r ' | shasum -a 256 | awk '{print "key-" substr($1, 57, 8)}'
  1. Rename your public key using the generated filename.