Sylius / Sylius-Standard

Open Source eCommerce Application on top of Symfony
https://sylius.com
MIT License
242 stars 319 forks source link

Incorrect check in Makefile #1018

Open Michal-Szczepaniak opened 1 month ago

Michal-Szczepaniak commented 1 month ago

In the Makefile file, there's a check that checks if docker exists, but the issue is that you used DOCKER_COMPOSE variable

@which $(DOCKER_COMPOSE) > /dev/null || (echo "Please install docker compose binary" && exit 1)

and DOCKER_COMPOSE variable consists of docker compose which in turn causes which docker compose command, and while docker command exists, compose command does not exist because its parameter to the docker command, so the check fails and currently make init will always fail on every system unless they somehow got command named compose

bwmirek commented 1 month ago

for quick workaround, until its solved, just update the check

@$(DOCKER_COMPOSE) version > /dev/null || (echo "Please install docker compose binary" && exit 1)
Michal-Szczepaniak commented 1 month ago

I think the better solution would be @which docker > /dev/null

bwmirek commented 1 month ago

this would check if docker is installed but we want to check specifically if docker compose is installed, as they are different things and can be installed separately

Michal-Szczepaniak commented 1 month ago

Then check if /usr/lib/docker/cli-plugins/docker-compose exists

bwmirek commented 1 month ago

i'm afraid it won't work either, docker may be installed in different places, especially if you install the desktop version

for example on my current machine docker is under /usr/local/docker and on my windows machine it is /mnt/c/Program Files/Docker/Docker

imo docker compose version is safer bet as it only requires to set correct $PATH