Docker: 'compose' is not a docker command - MAC OS X

Hello,

I have been trying to resolve this on another forum but to no avail. They have told me to ask you what to do in this case.

I am using Mac OS X the latest Apple Silicon version of MacBook Air and latest version of Ventura 13.5.
After I open Docker and then open Terminal and enter the command ‘docker compose up’, this is the error I am getting:

docker: ‘compose’ is not a docker command.
See ‘docker --help’

I am not sure if this has to do with some docker command update related to Mac, but it seems that it won’t recognise docker compose up as a command at all. I guess there is a different command instead of this one to replace this one? Is there any such alternative docker command?

*. * *

In addition to my previous comment, I decided to look into ‘docker --help’, and this is what I got after I entered it:

Usage: docker [OPTIONS] COMMAND

A self-sufficient runtime for containers

Common Commands:
run Create and run a new container from an image
exec Execute a command in a running container
ps List containers
build Build an image from a Dockerfile
pull Download an image from a registry
push Upload an image to a registry
images List images
login Log in to a registry
logout Log out from a registry
search Search Docker Hub for images
version Show the Docker version information
info Display system-wide information

Management Commands:
builder Manage builds
container Manage containers
context Manage contexts
extension* Manages Docker extensions (Docker Inc., v0.2.19)
image Manage images
init* Creates Docker-related starter files for your project (Docker Inc., v0.1.0-beta.4)
manifest Manage Docker image manifests and manifest lists
network Manage networks
plugin Manage plugins
system Manage Docker
trust Manage trust on Docker images
volume Manage volumes

Swarm Commands:
swarm Manage Swarm

Commands:
attach Attach local standard input, output, and error streams to a running container
commit Create a new image from a container’s changes
cp Copy files/folders between a container and the local filesystem
create Create a new container
diff Inspect changes to files or directories on a container’s filesystem
events Get real time events from the server
export Export a container’s filesystem as a tar archive
history Show the history of an image
import Import the contents from a tarball to create a filesystem image
inspect Return low-level information on Docker objects
kill Kill one or more running containers
load Load an image from a tar archive or STDIN
logs Fetch the logs of a container
pause Pause all processes within one or more containers
port List port mappings or a specific mapping for the container
rename Rename a container
restart Restart one or more containers
rm Remove one or more containers
rmi Remove one or more images
save Save one or more images to a tar archive (streamed to STDOUT by default)
start Start one or more stopped containers
stats Display a live stream of container(s) resource usage statistics
stop Stop one or more running containers
tag Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE
top Display the running processes of a container
unpause Unpause all processes within one or more containers
update Update configuration of one or more containers
wait Block until one or more containers stop, then print their exit codes

Invalid Plugins:
buildx failed to fetch metadata: fork/exec /Users/MyMac/.docker/cli-plugins/docker-buildx: no such file or directory
compose failed to fetch metadata: fork/exec /Users/MyMac/.docker/cli-plugins/docker-compose: no such file or directory
dev failed to fetch metadata: fork/exec /Users/MyMac/.docker/cli-plugins/docker-dev: no such file or directory
sbom failed to fetch metadata: fork/exec /Users/MyMac/.docker/cli-plugins/docker-sbom: no such file or directory
scan failed to fetch metadata: fork/exec /Users/MyMac/.docker/cli-plugins/docker-scan: no such file or directory
scout failed to fetch metadata: fork/exec /Users/MyMac/.docker/cli-plugins/docker-scout: no such file or directory

Global Options:
–config string Location of client config files (default
“/Users/MyMac/.docker”)
-c, --context string Name of the context to use to connect to the
daemon (overrides DOCKER_HOST env var and
default context set with “docker context use”)
-D, --debug Enable debug mode
-H, --host list Daemon socket(s) to connect to
-l, --log-level string Set the logging level (“debug”, “info”,
“warn”, “error”, “fatal”) (default “info”)
–tls Use TLS; implied by --tlsverify
–tlscacert string Trust certs signed only by this CA (default
“/Users/MyMac/.docker/ca.pem”)
–tlscert string Path to TLS certificate file (default
“/Users/MyMac/.docker/cert.pem”)
–tlskey string Path to TLS key file (default
“/Users/MyMac/.docker/key.pem”)
–tlsverify Use TLS and verify the remote
-v, --version Print version information and quit

Run ‘docker COMMAND --help’ for more information on a command.

For more help on how to use Docker, head to Docker Docs

*. * *

Please, I need some help, I am extremely lost and confused and just don’t get it. Can anybody help with a step to step on how to have this fixed as I am very new to this and it seems very complicated and confusing to me?

Thank you,

C

I haven’t read everything you wrote (please, format your post next time using the code block icon (</>) but this issue seems to be the same

And another permission issue I reffered to:

Hello,

Thank you for the fast reply. I am new and will do that in the future.

I tried your solution and first entered this:
ls -ld /usr/local/bin

Then I got this as a result:
drwxr-xr-x 14 root wheel 448 Mar 26 02:29 /usr/local/bin

Then I entered this:
chmod +x /usr/local/bin

Then I restarted both Docker and Terminal, but I keep getting the ‘compose’ is not a docker command error after I enter ‘docker compose up’

Please help me, I am very lost.

Hello,

It’s been 10 days and nothing works. Is there anybody who could help me with the issue please?

Do Docker developers know that this issue persists with Macs?

Thank you,

C

I am sorry for the not so fast response this time.

Since your folder had the executable flag already, there was really no point of running chmod, but I wrote about much more in the topics I linked. Everything has to exist and be executable including the binaries. What is missing or wrong can be different for everyone.

In the topic that I linked first, I also shared a link to my video where I talked about completeley removing Docker Desktop on Mac which can help sometimes, but the user actually solved it by disabling some security software.

You can let them know in the “docker/for-mac” repository on Github if they don’t.

1 Like

Hello, and thank you for your help.

After I followed your videos and completely uninstalled and then reinstalled Docker, then compose up worked.

Thank you so much for your help and have an amazing weekend.