|
48 | 48 |
|
49 | 49 |
|
50 | 50 |
|
| 51 | +build/%: DOCKER_BUILD_ARGS?= |
51 | 52 | build/%: ## build the latest image for a stack using the system's architecture
|
52 | 53 | @echo "::group::Build $(OWNER)/$(notdir $@) (system's architecture)"
|
53 |
| - docker build --rm --force-rm -t $(OWNER)/$(notdir $@):latest ./$(notdir $@) --build-arg OWNER=$(OWNER) |
| 54 | + docker build $(DOCKER_BUILD_ARGS) --rm --force-rm -t $(OWNER)/$(notdir $@):latest ./$(notdir $@) --build-arg OWNER=$(OWNER) |
54 | 55 | @echo -n "Built image size: "
|
55 | 56 | @docker images $(OWNER)/$(notdir $@):latest --format "{{.Size}}"
|
56 | 57 | @echo "::endgroup::"
|
@@ -96,15 +97,16 @@ build-all: $(foreach I, $(ALL_IMAGES), build/$(I)) ## build all stacks
|
96 | 97 | # without needing to update this Makefile, and if all tests succeeds we can
|
97 | 98 | # do a publish job that creates a multi-platform image for us.
|
98 | 99 | #
|
| 100 | +build-multi/%: DOCKER_BUILD_ARGS?= |
99 | 101 | build-multi/%: ## build the latest image for a stack on both amd64 and arm64
|
100 | 102 | @echo "::group::Build $(OWNER)/$(notdir $@) (system's architecture)"
|
101 |
| - docker buildx build -t $(OWNER)/$(notdir $@):latest ./$(notdir $@) --build-arg OWNER=$(OWNER) --load |
| 103 | + docker buildx build $(DOCKER_BUILD_ARGS) -t $(OWNER)/$(notdir $@):latest ./$(notdir $@) --build-arg OWNER=$(OWNER) --load |
102 | 104 | @echo -n "Built image size: "
|
103 | 105 | @docker images $(OWNER)/$(notdir $@):latest --format "{{.Size}}"
|
104 | 106 | @echo "::endgroup::"
|
105 | 107 |
|
106 | 108 | @echo "::group::Build $(OWNER)/$(notdir $@) (amd64,arm64)"
|
107 |
| - docker buildx build -t build-multi-tmp-cache/$(notdir $@):latest ./$(notdir $@) --build-arg OWNER=$(OWNER) --platform "linux/amd64,linux/arm64" |
| 109 | + docker buildx build $(DOCKER_BUILD_ARGS) -t build-multi-tmp-cache/$(notdir $@):latest ./$(notdir $@) --build-arg OWNER=$(OWNER) --platform "linux/amd64,linux/arm64" |
108 | 110 | @echo "::endgroup::"
|
109 | 111 | build-all-multi: $(foreach I, $(MULTI_IMAGES), build-multi/$(I)) $(foreach I, $(AMD64_ONLY_IMAGES), build/$(I)) ## build all stacks
|
110 | 112 |
|
@@ -181,9 +183,10 @@ push/%: ## push all tags for a jupyter image
|
181 | 183 | @echo "::endgroup::"
|
182 | 184 | push-all: $(foreach I, $(ALL_IMAGES), push/$(I)) ## push all tagged images
|
183 | 185 |
|
| 186 | +push-multi/%: DOCKER_BUILD_ARGS?= |
184 | 187 | push-multi/%: ## push all tags for a jupyter image that support multiple architectures
|
185 | 188 | @echo "::group::Push $(OWNER)/$(notdir $@) (amd64,arm64)"
|
186 |
| - docker buildx build $($(subst -,_,$(notdir $@))_EXTRA_TAG_ARGS) -t $(OWNER)/$(notdir $@):latest ./$(notdir $@) --build-arg OWNER=$(OWNER) --platform "linux/amd64,linux/arm64" --push |
| 189 | + docker buildx build $(DOCKER_BUILD_ARGS) $($(subst -,_,$(notdir $@))_EXTRA_TAG_ARGS) -t $(OWNER)/$(notdir $@):latest ./$(notdir $@) --build-arg OWNER=$(OWNER) --platform "linux/amd64,linux/arm64" --push |
187 | 190 | @echo "::endgroup::"
|
188 | 191 | push-all-multi: $(foreach I, $(MULTI_IMAGES), push-multi/$(I)) $(foreach I, $(AMD64_ONLY_IMAGES), push/$(I)) ## push all tagged images
|
189 | 192 |
|
|
0 commit comments