Configure Alpine with Nexus
Configure your Alpine client to connect to a Nexus Alpine repository. Alpine uses the /etc/apk/repositories file to define repository endpoints. Note that you must create an Alpine repository in Nexus before configuring your Alpine client to connect to it. Refer to Create an Alpine Repository for more details.
Note
Testing indicates that Alpine Linux 3.17 or later, using apk-tools 2.12.14 or later, is required for compatibility with Alpine repositories in Nexus Repository. Alpine Linux 3.16 with apk-tools 2.12.9 can return a package file format error when reading repository metadata.
Configure the Alpine Repository URL
Use the following syntax to configure an Alpine repository URL:
https://<nexus-host>/repository/<repository-name>/<alpine-version>/<channel>
Where,
<nexus-host>- Host name and port for your Nexus Repository instance<repository-name>- Target Alpine repository in Nexus<alpine-version>- Alpine version path, for examplev3.19oredge<channel>- Alpine repository channel, for examplemainorcommunity
For example:
https://example.nexus.com/repository/alpine-group/v3.19/main
Add the Repository URL to Alpine
Add the Nexus Alpine repository URL to /etc/apk/repositories.
echo "https://<nexus-host>/repository/<repository-name>/<alpine-version>/<channel>" >> /etc/apk/repositories
Where,
<nexus-host>- Host name and port for your Nexus Repository instance<repository-name>- Name of the target Alpine repository in Nexus<alpine-version>- Alpine version path<channel>- Alpine repository channel
For example:
echo "https://example.nexus.com/repository/alpine-group/v3.19/main" >> /etc/apk/repositories
Add The Public Key
If your Alpine repository uses signed metadata, add the public key generated during repository setup to the Alpine trusted keys directory at /etc/apk/keys/. Update the package index after adding the public key.
If you do not add the public key, you can use --allow-untrusted when installing a package. Sonatype does not recommend this option because it bypasses Alpine package signature trust checks.