File tree 1 file changed +5
-4
lines changed
1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -2,13 +2,14 @@ DOCKERHUB_REPO := $(shell cat ./docker_repo.var)
2
2
DOCKER_TAG ?= $(shell git rev-parse --short HEAD)
3
3
DOCKER_IMAGE := $(DOCKERHUB_REPO ) :$(DOCKER_TAG )
4
4
DOCKER_IMAGE_LATEST := $(DOCKERHUB_REPO ) :latest
5
+ DOCKER_COMPOSE_CMD := $(shell if command -v docker-compose > /dev/null; then echo "docker-compose"; else echo "docker compose"; fi)
5
6
6
7
# `DOCKER_IMAGE_BRANCH` tag is the git tag for the commit if it exists, else the branch on which the commit exists
7
8
DOCKER_IMAGE_BRANCH := $(DOCKERHUB_REPO ) :$(shell git describe --exact-match --tags 2> /dev/null || git symbolic-ref --short HEAD)
8
9
9
10
# .PHONY: build
10
11
build :
11
- docker-compose -f docker-compose.dev.yml build
12
+ $( DOCKER_COMPOSE_CMD ) -f docker-compose.dev.yml build
12
13
13
14
.PHONY : build-full
14
15
build-full :
@@ -27,12 +28,12 @@ publish-latest:
27
28
28
29
.PHONY : start
29
30
start :
30
- docker-compose -f docker-compose.dev.yml up
31
+ $( DOCKER_COMPOSE_CMD ) -f docker-compose.dev.yml up
31
32
32
33
.PHONY : stop
33
34
stop :
34
- docker-compose -f docker-compose.dev.yml down
35
+ $( DOCKER_COMPOSE_CMD ) -f docker-compose.dev.yml down
35
36
36
37
.PHONY : stop-full
37
38
stop-v :
38
- docker-compose -f docker-compose.dev.yml down -v
39
+ $( DOCKER_COMPOSE_CMD ) -f docker-compose.dev.yml down -v
You can’t perform that action at this time.
0 commit comments