Skip to content
This repository was archived by the owner on Jul 18, 2025. It is now read-only.

Commit 7a634f4

Browse files
committed
Clean git branch name for docker image name
To allow working on branches with special char in it (like release/v0.3.0 or …) Signed-off-by: Vincent Demeester <[email protected]>
1 parent 4dc7080 commit 7a634f4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ BIND_DIR := $(if $(DOCKER_HOST),,bundles)
1414
LIBCOMPOSE_MOUNT := $(if $(BIND_DIR),-v "$(CURDIR)/$(BIND_DIR):/go/src/github.com/docker/libcompose/$(BIND_DIR)")
1515

1616
GIT_BRANCH := $(shell git rev-parse --abbrev-ref HEAD 2>/dev/null)
17-
LIBCOMPOSE_IMAGE := libcompose-dev$(if $(GIT_BRANCH),:$(GIT_BRANCH))
17+
GIT_BRANCH_CLEAN := $(shell echo $(GIT_BRANCH) | sed -e "s/[^[:alnum:]]/-/g")
18+
LIBCOMPOSE_IMAGE := libcompose-dev$(if $(GIT_BRANCH_CLEAN),:$(GIT_BRANCH_CLEAN))
1819

1920
DAEMON_VERSION := $(if $(DAEMON_VERSION),$(DAEMON_VERSION),"default")
2021
TTY := $(shell [ -t 0 ] && echo "-t")

0 commit comments

Comments
 (0)