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

Commit 3f9fc90

Browse files
authored
Merge pull request #349 from vdemeester/fix-git-branch
Clean git branch name for docker image name
2 parents c66e350 + 7a634f4 commit 3f9fc90

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)