Docker compose with makefile

Hello,

Question :

Is it normal to get a different result when the command “docker compose kill” is launched from the terminal or via a makefile?

Example :

docker compose kill :

maline@maline-mpinto:~/travail/maline/malinev3/docker$ docker compose up -d
[+] Running 7/7
 ⠿ Network malinev3_network_dev     Created  0.0s
 ⠿ Container malinev3_openapi_ui    Started  0.7s
 ⠿ Container malinev3_rabbitmq      Started  0.8s
 ⠿ Container malinev3_database_sql  Healthy  2.2s
 ⠿ Container malinev3_service_php   Started  0.9s
 ⠿ Container malinev3_api_gateway   Started  1.2s
 ⠿ Container malinev3_keycloak      Started  2.5s

make kill :

maline@maline-mpinto:~/travail/maline/malinev3/docker$ make kill
docker compose kill
no container to kill

Of course, I built the containers again between the two commands

Please share the Makefile. It should not make a difference if used identicaly.

Thanks to your answer I wondered about my makfile because I had just added:

# protège les appels aux commandes make xxx
.PHONY: kill build down

include .env
export 
DOCKER_PROJECT = ${PROJECT_NAME}

kill:
	docker compose kill

build:
	docker compose up -d --build

down:
	docker compose down

But obviously the line break is the cause of the problem.

# protège les appels aux commandes make xxx
.PHONY: kill build down

include .env
export DOCKER_PROJECT = ${PROJECT_NAME}

kill:
	docker compose kill

build:
	docker compose up -d --build

down:
	docker compose down

Thanks.

I am unclear wether you found the problem or not.

hello, of course, the “export” command in the makefile was not correctly written. And suddenly the makefile was wrong

I put the before/after in my previous post.

Thank you :slight_smile: