Skip to content

Commit 8aa4747

Browse files
authored
Support overriding base image via build arg (#571)
* Support overriding base image via build arg Add BASE_IMAGE build arg to allow building Canasta with a custom CanastaBase image. This enables the Canasta CLI's --build-from flag to build both CanastaBase and Canasta from local source repositories. Default behavior is unchanged (uses ghcr.io/canastawiki/canasta-base:1.0.7). * Fix CI workflow to extract BASE_IMAGE from ARG line The Dockerfile now uses an ARG for the base image instead of hardcoding it in the FROM line. Update the awk command to parse the default value from the ARG line.
1 parent 9562717 commit 8aa4747

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

.github/workflows/docker-image.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
id: extract_mw
4747
run: |
4848
set -euo pipefail
49-
BASE_IMAGE=$(awk '/^FROM ghcr\.io\/canastawiki\/canasta-base/ {print $2}' Dockerfile)
49+
BASE_IMAGE=$(awk -F'=' '/^ARG BASE_IMAGE=/ {print $2}' Dockerfile)
5050
docker pull "$BASE_IMAGE" >/dev/null
5151
MW_VERSION=$(docker inspect --format '{{ index .Config.Labels "wiki.canasta.mediawiki.version" }}' "$BASE_IMAGE")
5252
echo "MW_VERSION=$MW_VERSION"

Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
FROM ghcr.io/canastawiki/canasta-base:1.0.7 AS base
1+
ARG BASE_IMAGE=ghcr.io/canastawiki/canasta-base:1.0.7
2+
FROM ${BASE_IMAGE} AS base
23

34
LABEL maintainers=""
45
LABEL org.opencontainers.image.source=https://github.com/CanastaWiki/Canasta

0 commit comments

Comments
 (0)