Skip to content

Commit d894c3f

Browse files
authored
Use regctl to read MW version label without pulling image (#596)
Replace docker pull + docker inspect with regctl image config to extract the MW_VERSION label from CanastaBase. This reads the label directly from the registry manifest (~KB) instead of downloading the full ~700MB image, reducing the step from ~30s to a few seconds.
1 parent a31443d commit d894c3f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

.github/workflows/docker-image.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,16 @@ jobs:
4040
steps:
4141
- name: Checkout
4242
uses: actions/checkout@v3
43+
-
44+
name: Install regctl
45+
uses: regclient/actions/regctl-installer@v0.1
4346
-
4447
name: Extract MW_VERSION from CanastaBase labels
4548
id: extract_mw
4649
run: |
4750
set -euo pipefail
4851
BASE_IMAGE=$(awk -F'=' '/^ARG BASE_IMAGE=/ {print $2}' Dockerfile)
49-
docker pull "$BASE_IMAGE" >/dev/null
50-
MW_VERSION=$(docker inspect --format '{{ index .Config.Labels "wiki.canasta.mediawiki.version" }}' "$BASE_IMAGE")
52+
MW_VERSION=$(regctl image config "$BASE_IMAGE" | jq -r '.config.Labels["wiki.canasta.mediawiki.version"]')
5153
echo "MW_VERSION=$MW_VERSION"
5254
echo "MW_VERSION=$MW_VERSION" >> $GITHUB_ENV
5355

0 commit comments

Comments
 (0)