Skip to content

Commit 28fcc6e

Browse files
mnpmitch-wallaroomathbunnyru
authored
Surface PYTHON_VERSION as a Makefile variable (#2208)
* * Surface PYTHON_VERSION as a Makefile variable. This can be overridden like `make PYTHON_VERSION=3.10 build-all`. * Wrap and indent a growing command line. * Update Makefile * Update Makefile --------- Co-authored-by: Mitchell Perilstein <[email protected]> Co-authored-by: Ayaz Salikhov <[email protected]>
1 parent 976ed6c commit 28fcc6e

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

Makefile

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,18 @@ help:
3535

3636

3737

38+
# Note that `ROOT_IMAGE` and `PYTHON_VERSION` arguments are only applicable to `docker-stacks-foundation` image
3839
build/%: DOCKER_BUILD_ARGS?=
3940
build/%: ROOT_IMAGE?=ubuntu:24.04
41+
build/%: PYTHON_VERSION?=3.12
4042
build/%: ## build the latest image for a stack using the system's architecture
41-
docker build $(DOCKER_BUILD_ARGS) --rm --force-rm --tag "$(REGISTRY)/$(OWNER)/$(notdir $@):latest" "./images/$(notdir $@)" --build-arg REGISTRY="$(REGISTRY)" --build-arg OWNER="$(OWNER)" --build-arg ROOT_IMAGE="$(ROOT_IMAGE)"
43+
docker build $(DOCKER_BUILD_ARGS) --rm --force-rm \
44+
--tag "$(REGISTRY)/$(OWNER)/$(notdir $@):latest" \
45+
"./images/$(notdir $@)" \
46+
--build-arg REGISTRY="$(REGISTRY)" \
47+
--build-arg OWNER="$(OWNER)" \
48+
--build-arg ROOT_IMAGE="$(ROOT_IMAGE)" \
49+
--build-arg PYTHON_VERSION="$(PYTHON_VERSION)"
4250
@echo -n "Built image size: "
4351
@docker images "$(REGISTRY)/$(OWNER)/$(notdir $@):latest" --format "{{.Size}}"
4452
build-all: $(foreach I, $(ALL_IMAGES), build/$(I)) ## build all stacks

0 commit comments

Comments
 (0)