Sign inSign up

cwaits6/apk-datasource

By cwaits6

Updated 8 days ago

Auto-update pinned APK package versions in Dockerfiles via Renovate custom datasource

Image
Security
Developer tools
0

2.0K

cwaits6/apk-datasource repository overview

apk-datasource

Auto-update pinned APK package versions in Dockerfiles using Renovate. Serves Renovate-compatible custom datasource JSON over HTTP for Wolfi and Alpine packages.

The Problem: Renovate has no built-in datasource for APK packages, so apk add curl=8.11.1-r0 in your Dockerfiles can't be auto-updated. This tool solves that.

Quick Start

Defaults to Chainguard Wolfi x86_64 and aarch64:

docker run -p 3000:3000 cwaits6/apk-datasource serve

Or specify your own index:

docker run -p 3000:3000 cwaits6/apk-datasource serve \
  --index-url https://dl-cdn.alpinelinux.org/alpine/v3.23/main/x86_64/APKINDEX.tar.gz

Endpoints

PathDescription
/{arch}/{package}Renovate JSON datasource for a package
/metricsPrometheus metrics
/healthzLiveness probe
/readyzReadiness probe

Configuration

FlagDefaultDescription
--index-urlChainguard Wolfi (x86_64, aarch64)APKINDEX.tar.gz URL (repeatable)
--port3000HTTP port
--refresh-interval4hIndex refresh interval
--metricstrueEnable Prometheus /metrics

Docker Compose

services:
  apk-datasource:
    image: cwaits6/apk-datasource:latest
    command:
      - serve
      - --refresh-interval=4h
    ports:
      - "3000:3000"
    environment:
      - LOG_LEVEL=info

Renovate Setup

Add to your renovate.json:

{
  "customDatasources": {
    "apk-wolfi": {
      "defaultRegistryUrlTemplate": "http://apk-datasource:3000/{arch}/{{packageName}}.json",
      "format": "json"
    }
  },
  "customManagers": [
    {
      "customType": "regex",
      "fileMatch": ["(^|/)Dockerfile[^/]*$"],
      "matchStrings": [
        "apk\\s+add[^\\n\\\\]*(?:\\\\[^\\S\\n]*\\n[^\\n\\\\]*)*",
        "(?<depName>[a-zA-Z0-9][a-zA-Z0-9._+-]*)=(?<currentValue>\\d+[^\\s\\\\]+)"
      ],
      "datasourceTemplate": "custom.apk-wolfi",
      "versioningTemplate": "loose"
    }
  ]
}

Supported Indexes

  • Chainguard Wolfi (default) — https://apk.cgr.dev/chainguard/{arch}/APKINDEX.tar.gz
  • Alpine Linuxhttps://dl-cdn.alpinelinux.org/alpine/v{version}/{repo}/{arch}/APKINDEX.tar.gz

Tag summary

Content type

Image

Digest

sha256:32789f643

Size

11.6 MB

Last updated

8 days ago

docker pull cwaits6/apk-datasource