Here's how you do it.
If you can use Homebrew, do
brew install docker-compose
and pay heed to the notes after the installer runs. They tell you to add
"cliPluginsExtraDirs": [
"/opt/homebrew/lib/docker/cli-plugins"
]
to your ~/.docker/config.json file.
I don't know if Homebrew also installs Credentials Helper with Compose, so you might have to do:
brew install docker-credential-helper
If you can't use Homebrew, I think you'll have to do the following.
Install Credentials Helper using Docker's instructions here.
Go into ~/.docker/config.json and make sure the value for credsStore is osxkeychain. My file looks like:
{
"auths": {},
"credsStore": "osxkeychain",
"currentContext": "colima",
"plugins": {
"debug": {
"hooks": "exec"
},
"scout": {
"hooks": "pull,buildx build"
}
},
"features": {
"hooks": "true"
}
}
Download latest Docker Compose from here for your architecture (aarch64 for Apple Silicon): https://github.com/docker/compose/releases/latest
Copy the executable to /usr/local/bin, naming it docker-compose.
From there, make sure it's executable:
sudo chmod +x docker-compose
Clear Apple's scareware:
sudo xattr -d com.apple.quarantine docker-compose
As in the Homebrew case, add
"cliPluginsExtraDirs": [
"/opt/homebrew/lib/docker/cli-plugins"
]
to your ~/.docker/config.json file.
Open a new terminal session and try
docker compose version
If that doesn't work, try
docker-compose version
If that works, the cliPluginsExtraDirs entry in the config.json file isn't working.
[MacOS] Can I get away with just docker CLI and Docker-compose CLI?
install docker docker-compose on mac
How to install docker-compose v2 in Mac Ventura?
Can Someone please help me understand how to use Compose with Docker Desktop?
Videos
Hello everyone,
I am a long-time Windows user, but I am finally making the switch to a MacBook Pro M1 Pro for development. I tried switching a year ago but couldn't make the transition at that time. For my daily tasks, I need to use Docker.
I believe that I can accomplish what I need with just the Docker CLI and Docker Compose CLI. However, since I am not very familiar with the macOS ecosystem, there might be some options I am overlooking.
Here is what I need:
-
Build and run Docker containers
-
Orchestration via Docker Compose
-
ARM native support
-
Kubernetes would be nice, but it's not a requirement
On Windows, I have been using Docker Desktop. Since I am transitioning to a completely new ecosystem, I wanted to explore the available options. Here is what I have found:
-
Podman
-
Rancher Desktop
-
Colima
-
Orbstack
-
And of course, Docker Desktop
I prefer CLI tools for the most part, as long as they are robust and easy to use. While I am not opposed to GUIs, I spend most of my time in the terminal. As long as the software is well-built, fast, and does not consume excessive resources, I am fine.
Any input or advice you might have would be greatly appreciated.
Thanks a lot!
I installed Docker Desktop recently in an effort to understand docker and since several apps I've found have had that as almost the only way to install. I've been able to pull the images for what I was trying out, start it, set the port/volumes so that data/config is saved, and all is well.
Now I'm trying to use some other apps I've come across which have more than one service included (postgres as a DB in this case) and it looks like Compose is pretty much required for that. I tried just running another container with postgres but wasn't able to get that working.
I checked in Docker Desktop and can see Compose is installed but no idea how to use it. When I have tried to google it nothing is actually using Desktop but is using a command line instead. I have no idea how to get to that command line or even if I can where the compose directory would be to put the yaml file if I did. What documentation I have found had been pretty much useful so I don't know if I completely down the wrong path.
Edit: Thank you everyone. With the info from hirakath I am now up and running. Biggest issue I believe is that I have worked mostly in Windows through the years and had never heard anyone refer to the command prompt as terminal. I thought that was something different and I wasn't understanding where to find it. I am by no means a developer and just using this to learn and experiment with some programs I believe would be useful.