From 40b59f8cf8569e89d8d51e9f912bd205d5cd2ef0 Mon Sep 17 00:00:00 2001 From: Kunal Bauskar Date: Sun, 8 Nov 2026 23:05:36 +0530 Subject: [PATCH] Quote BRANCH and APP_METADATA build args in Makefile.pf9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Builds of the default branch failed with: /bin/sh: default: No such file or directory Exit code 2 (Step: Build and push ... container) TeamCity sets TEAMCITY_BUILD_BRANCH to the literal string "" when a build runs on the VCS root's default branch. That value reached the docker build line unquoted, so the shell parsed "<" and ">" as redirection operators and tried to open a file named "default" instead of passing the value through. APP_METADATA gets the same treatment: it carries JSON, whose braces, spaces and quotes break the same way once it is non-empty. The remaining build args (GO_VERSION, GOOS, BUILD_ID, ...) are left as they are — their values are always simple tokens. Co-Authored-By: Claude Opus 5 --- Makefile.pf9 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile.pf9 b/Makefile.pf9 index 96648cee..ab98103a 100644 --- a/Makefile.pf9 +++ b/Makefile.pf9 @@ -42,8 +42,8 @@ build: --build-arg CGO_ENABLED=$(CGO_ENABLED) \ --build-arg VERSION=$(PF9_VERSION) \ --build-arg BUILD_ID=$(BUILD_NUMBER) \ - --build-arg BRANCH=$(BRANCH) \ - --build-arg APP_METADATA=$(APP_METADATA) \ + --build-arg BRANCH='$(BRANCH)' \ + --build-arg APP_METADATA='$(APP_METADATA)' \ -f $(DOCKERFILE) -t $(FULL_IMAGE) . $(DOCKER) tag $(FULL_IMAGE) $(ECR_FULL_IMAGE) echo $(IMAGE_TAG) > container-tag