build-route-proxy-image.sh builds FROM the bases the manifest declares
This commit is contained in:
@@ -22,7 +22,18 @@ DOCKERFILE="$MESH_CATALOG/modules/route-proxy/Dockerfile"
|
|||||||
[ -f "$MESH_CONTROL/examples/route-proxy/main.go" ] || {
|
[ -f "$MESH_CONTROL/examples/route-proxy/main.go" ] || {
|
||||||
echo "no proxy source at $MESH_CONTROL/examples/route-proxy" >&2; exit 1; }
|
echo "no proxy source at $MESH_CONTROL/examples/route-proxy" >&2; exit 1; }
|
||||||
|
|
||||||
|
# The bases the manifest declares (novox/hq ADR 0097) are what this build starts FROM — the same
|
||||||
|
# images the mesh's builder would copy and hand the recipe, not the Dockerfile's floating defaults.
|
||||||
|
BASES=()
|
||||||
|
while IFS=$'\t' read -r arg image; do
|
||||||
|
[ -n "$arg" ] && BASES+=(--build-arg "$arg=$image")
|
||||||
|
done < <(python3 -c '
|
||||||
|
import json, sys
|
||||||
|
for on in json.load(open(sys.argv[1])).get("build", {}).get("on", []):
|
||||||
|
print(on["arg"], on["image"], sep="\t")
|
||||||
|
' "$MESH_CATALOG/modules/route-proxy/module.json")
|
||||||
|
|
||||||
# Context is the mesh-controller repository root: the proxy compiles against that module's go.mod and
|
# Context is the mesh-controller repository root: the proxy compiles against that module's go.mod and
|
||||||
# its examples/route-proxy package.
|
# its examples/route-proxy package.
|
||||||
docker build -f "$DOCKERFILE" -t "$TAG" "$MESH_CONTROL"
|
docker build -f "$DOCKERFILE" "${BASES[@]}" -t "$TAG" "$MESH_CONTROL"
|
||||||
echo "built $TAG (from $MESH_CONTROL/examples/route-proxy)"
|
echo "built $TAG (from $MESH_CONTROL/examples/route-proxy)"
|
||||||
|
|||||||
Reference in New Issue
Block a user