Alpine APK publishing and architecture indexes
Alpine accepts one repository base URL per line. apk appends the system architecture and APKINDEX.tar.gz. Publish to an explicit branch, component, and architecture to match the client configuration.
Create repositories
Run these Bash commands with an authenticated administrator arkactl profile and jq. Replace the example address with your HTTPS endpoint. Publish to Hosted. Group looks in Hosted first, then in Proxy. Grant the publishing account write access to Hosted and the consuming account read access to Group and the relevant members.
For each consuming or publishing identity, sign in with its profile and run arkactl --json tokens create --name alpine-ci --expires-in-days 30 | jq -er .plaintext. Send the output directly to the CI secret store. Use a separate read and write token for the examples below.
export ARKA_URL=https://packages.example.org
hosted=$(arkactl --json repo create --name alpine-hosted --type hosted --format alpine | jq -er .id)
proxy=$(arkactl --json repo create --name alpine-proxy --type proxy --format alpine \
--upstream-url https://dl-cdn.alpinelinux.org/alpine | jq -er .id)
arkactl repo create --name alpine-group --type group --format alpine --member "$hosted,$proxy"
WRITE="$ARKA_URL/repository/alpine-hosted"
READ="$ARKA_URL/repository/alpine-group"Publish and configure the repository
arch=$(apk --print-arch)
pkg=widget-1.2.3-r0.apk
curl -fsS -H "Authorization: Bearer $ARKA_WRITE_TOKEN" \
-T "$pkg" "$WRITE/v3.22/main/$arch/$pkg"The driver reads the package name, version, and architecture from APK v2 .PKGINFO. The architecture in the upload path must match the package. Verify a noarch package against the relevant indexes. A bare filename defaults to v3.20/main. Add the following line to /etc/apk/repositories.
https://packages.example.org/repository/alpine-group/v3.22/mainFor private HTTPS with Basic authentication, put https://READER:URL_ENCODED_READ_TOKEN@packages.example.org/repository/alpine-group/v3.22/main in a restricted temporary file. Pass it with --repositories-file and keep credentials out of source control and shared logs. The server also accepts Bearer tokens for CI uploads and direct file checks.
Refresh and verify
A Proxy can serve the upstream signed index. Install the distribution’s trusted key and run apk update and apk fetch widget. Hosted and Group indexes are unsigned. If you require signature verification end to end, use a signed upstream through Proxy and verify the trust chain with the native client.
Run these commands in an isolated test container. Point /tmp/wave.repositories at the test repository alone. The --allow-untrusted flag permits unsigned indexes. Compare the downloaded bytes with the known release artifact.
printf '%s/v3.22/main\n' "$READ" >/tmp/wave.repositories
mkdir -p pulled
apk --repositories-file /tmp/wave.repositories --allow-untrusted update
apk --repositories-file /tmp/wave.repositories --allow-untrusted fetch --output pulled widget
cmp "$pkg" "pulled/$pkg"| Symptom | What to check |
|---|---|
| UNTRUSTED signature | Check whether you are using a signed Proxy or an unsigned Group index. Install the distribution’s trusted key in the apk key directory. |
| The index loads but the package is missing | Check v3.22/main/<arch>/APKINDEX.tar.gz, then verify the P:, V:, and A: fields and dependency resolution. |
| Architecture mismatch during upload | Read the architecture from .PKGINFO and use it in the upload path. The repository base URL omits the architecture. |