26

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?

rob mayoff
  • 375,296
  • 67
  • 796
  • 848
naamadheya
  • 1,902
  • 5
  • 21
  • 28
  • You also need to actually launch the "whale" application; some tools don't actually get installed until it starts up the first time. – David Maze Apr 02 '20 at 14:17
  • @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. – naamadheya Apr 03 '20 at 06:32
  • @DavidMaze - Whale? I donot have that, could you send some links to get it up. – naamadheya Apr 03 '20 at 06:32
  • 1
    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. – David Maze Apr 03 '20 at 10:36

4 Answers4

43

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.

Yudhishthir Singh
  • 2,941
  • 2
  • 23
  • 42
33

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

Mickey Perlstein
  • 2,508
  • 2
  • 30
  • 37
4

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

PavanDevarakonda
  • 625
  • 5
  • 27
giocek
  • 115
  • 6
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.

Amit Kumar
  • 1,503
  • 14
  • 11
  • 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) – Llama D'Attore Jan 03 '23 at 20:52