Configure APK repositories

These examples show how to configure the /etc/apk/repositories file. For a full list of keys, refer to the APK configure module schema.

Keep the existing /etc/apk/repositories file unaltered.

1#cloud-config
2apk_repos:
3  preserve_repositories: true

Alpine v3.12

Create the repositories file for Alpine v3.12 main and community, using the default mirror site.

1#cloud-config
2apk_repos:
3  alpine_repo:
4    community_enabled: true
5    version: 'v3.12'

Alpine Edge

Create the repositories file for Alpine Edge main, community, and testing, using a specified mirror site and a local repo.

1#cloud-config
2apk_repos:
3  alpine_repo:
4    base_url: https://some-alpine-mirror/alpine
5    community_enabled: true
6    testing_enabled: true
7    version: edge
8  local_repo_base_url: https://my-local-server/local-alpine