Probably because an update, but I don't know why, my Makefiles cannot execute docker now. Do you have any idea?
➤ cat Makefile
dock:
docker ps
php:
php -v
➤ make dock
docker ps
make: docker: Permission denied
make: *** [Makefile:2: dock] Error 127
➤ make php 2 ↵
php -v
PHP 7.4.28 (cli) (built: Feb 17 2022 16:17:19) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Zend OPcache v7.4.28, Copyright (c), by Zend Technologies
➤ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
9c1ff6f5e0dc postgres:14.2-alpine "docker-entrypoint.s…" 9 days ago Up 4 minutes 0.0.0.0:5434->5432/tcp, :::5434->5432/tcp digital-docker-c-postgres-1
Thanks in advance
CodePudding user response:
You probably have a directory name docker
on your PATH. There's a bug in the current versions of GNU make (actually, it's a bug in gnulib) where it doesn't skip subdirectories of directories on the PATH.
You can either remove the docker
subdirectory, or force make to invoke a shell to run your command, maybe like this:
dock:
docker ps ;