docker-compose command not available for mac
Asked Answered
P

8

43

I installed docker with the instructions here, downloading from docker-hub

https://docs.docker.com/docker-for-mac/install/

But when I run docker-compose I get this error

pyenv: docker-compose: command not found

The `docker-compose' command exists in these Python versions:
3.6.5/envs/myenv

Also, docker-compose is available under /Users

which docker-compose
/Users/<username>/.pyenv/shims/docker-compose

In this link says, docker-compose for mac need not be installed explicitly as it is part of docker for desktop mac.

https://docs.docker.com/compose/install/

Is something wrong with my installation?

Prophylactic answered 2/4, 2020 at 13:33 Comment(4)
You also need to actually launch the "whale" application; some tools don't actually get installed until it starts up the first time.Stopcock
@RonvanderHeijden Yes, I do have, but that isn't the official Docker suggested way. Would installation from brew makes sure I get all features, like connecting to kubernates etc.Prophylactic
@DavidMaze - Whale? I donot have that, could you send some links to get it up.Prophylactic
If you've installed Docker for Mac (either via Homebrew or by downloading the installer yourself as per your link) there will be a "Docker" application in your Applications folder or the OS X Launchpad; it is circular, with a whale, with containers on its back. Start that application and the whale icon should appear in the menu bar. The first-time setup also adds some additional command-line tools and I think docker-compose is among those.Stopcock
B
49

I ran into the same issue on macOS today. Turned out that you need to run the installed app once, it does some additional downloading and setup. That setup includes setting up your path variables.

Baur answered 25/11, 2020 at 6:44 Comment(0)
P
74

docker-compose is a utility that is now a parameter in mac docker so instead of docker-compose up, its now docker compose up

Pilloff answered 25/7, 2021 at 13:5 Comment(4)
Mickey, using docker compose solved the issue for me. It's slightly odd. Do you have any documentation or any further read I can have on this. It will be useful.Intendance
lmgtfy - collabnix.com/docker-compose-now-shipped-with-docker-by-defaultPilloff
This should be the accepted answer now.Unread
thank you my friend. no hyphen worked for me.Dominick
B
49

I ran into the same issue on macOS today. Turned out that you need to run the installed app once, it does some additional downloading and setup. That setup includes setting up your path variables.

Baur answered 25/11, 2020 at 6:44 Comment(0)
R
14

This following steps worked for me:

  1. Install Docker Desktop as recommended.
  2. Run Docker Desktop.
  3. Go to Settings > Advanced Settings
  4. Check how Docker's CLI tools are installed and make sure they are in the right PATH.
  5. Under 'Choose how to configure the installation of Docker's CLI tools', I selected 'System' so that Docker CLI tools are installed under /usr/local/bin. Otherwise, follow the directions for the 'User' option (Docker CLI tools are installed under $HOME/.docker/bin.

Note: You need to manually add $HOME/.docker/bin to your environment variable PATH

Road answered 21/4, 2023 at 8:28 Comment(0)
G
8

Update Sept23: You need to install docker and docker-compose as CLI.

Ideally, it can be done by installing Docker Desktop but Desktop is not free & if you are using a company machine better check with tech ops first before installing it on your machine.

However, you can simply use brew on macOS to install both docker and docker-compose as I am describing here:

Run commands:

brew install docker

brew install docker-compose

Check the location where the docker-compose is installed:

which  docker-compose

It should return

/usr/local/bin/docker-compose

Now make docker-compose executable to run it from the Terminal :

chmod +x /usr/local/bin/docker-compose

That's it!! now you compose images via the terminal.

Gerous answered 20/9, 2023 at 12:16 Comment(0)
C
5

For the Docker desktop app on OSX go to settings -> advanced and change from the User CLI installation to the system settings then click Apply and restart

Screenshot of correct Docker settings to apply

Casimiracasimire answered 16/10, 2023 at 8:37 Comment(1)
thanks, we just simply got to: settings -> advanced save -> it worked. lol, i think i trigger to sth!Stolid
A
5

Today I faced same issue command not found: docker-compose ( it happened after os updates )

now it's :

$ docker compose up --build

It works now

Adrianadriana answered 12/7, 2024 at 4:1 Comment(2)
Wish I found these a few days ago... drove me crazy.Halftone
I faced it today, after update. Settings->Advanced->select User, Apply and Restart, get back to System, Apply and restart. docker-compose works nowGlassblowing
F
1

if you install docker from official website then docker-compose will come along with that for mac so need to either upgrade and documentation is present there.

Flyboat answered 27/11, 2021 at 13:35 Comment(1)
You need to run the GUI at least once after install. Otherwise the command line tools never get set up properly. (MacOS Ventura 13.1)Portemonnaie
E
0

for me I had to uninstall docker view homebrew because it's how I installed it brew uninstall --force docker and I installed via the official website https://docs.docker.com/desktop/install/mac-install/

Eyrir answered 15/7, 2024 at 9:54 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.