diff --git a/dotnet8/Makefile b/dotnet8/Makefile index b8c53c79..f16cc1a0 100644 --- a/dotnet8/Makefile +++ b/dotnet8/Makefile @@ -8,8 +8,8 @@ all: dotnet8-env-img dotnet8-builder-img dotnet8-env-img: Dockerfile @echo === Building image $(REPO)/dotnet8-env:$(TAG) using context $(CURDIR) and dockerfile $< - docker build --platform=$(PLATFORMS) -t $(REPO)/dotnet8-env:$(TAG) -f $< . + docker buildx build --platform=$(PLATFORMS) -t $(REPO)/dotnet8-env:$(TAG) $(DOCKER_FLAGS) -f $< . dotnet8-builder-img: builder/Dockerfile - @echo === Building image $(REPO)/dotnet8-builder:$(TAG) using context $(CURDIR)/builder and dockerfile $< - docker build --platform=$(PLATFORMS) -t $(REPO)/dotnet8-builder:$(TAG) -f $< builder/ \ No newline at end of file + @echo === Building image $(REPO)/dotnet8-builder:$(TAG) using context $(CURDIR) and dockerfile $< + docker build --platform=$(PLATFORMS) -t $(REPO)/dotnet8-builder:$(TAG) -f $< . \ No newline at end of file diff --git a/dotnet8/builder/Makefile b/dotnet8/builder/Makefile index 5bb6fbc0..a2a171af 100644 --- a/dotnet8/builder/Makefile +++ b/dotnet8/builder/Makefile @@ -5,4 +5,7 @@ PLATFORMS ?= linux/amd64,linux/arm64 .PHONY: all all: dotnet8-builder-img -dotnet8-builder-img: Dockerfile \ No newline at end of file +# Override the rule to use parent directory as context +dotnet8-builder-img: Dockerfile + @echo === Building image $(REPO)/dotnet8-builder:$(TAG) using parent directory as context + cd .. && docker buildx build --platform=$(PLATFORMS) -t $(REPO)/dotnet8-builder:$(TAG) $(DOCKER_FLAGS) -f builder/Dockerfile . \ No newline at end of file