Reputation: 129
I updated docker desktop for Mac (intel) this morning to Docker Desktop 4.9.1. My docker compose version won't seem to update. When I run docker-compose --version
in my terminal it returns docker-compose version 1.25.5, build unknown
. I tried installing docker-compose with brew and after some tinkering I got confirmation that it installed version 2.6.0, however after restarting docker desktop and my computer, I still get 1.25.5 when I run docker-compose --version
.
How can I force docker to use a newer version of docker-compose?
NOTE: In my docker-compose.yml file I have version 2 running.
Upvotes: 7
Views: 5612
Reputation: 11218
While mangers answer is correct I can't find such "after-install instruction". The current process differs. The new way to enable a plugin is to add the following section to the .docker/config.json
file:
{
"cliPluginsExtraDirs": [
"/opt/homebrew/lib/docker/cli-plugins"
]
}
Example:
mkdir -p ~/.docker
cd .docker
echo "{}" > $HOME/.docker/config.json
Additionally, I installed Docker Compose before this:
brew install docker-compose
Upvotes: 1
Reputation: 817
My docker compose also came via Docker Desktop on MacOS and it did not update/had the latest the latest version of docker-compose. I resolved this by installing docker-compose via brew:
https://formulae.brew.sh/formula/docker-compose
brew install docker-compose
Don't forget to follow the after-install instructions:
"Compose is now a Docker plugin. For Docker to find this plugin, symlink it:"
mkdir -p ~/.docker/cli-plugins
ln -sfn /opt/homebrew/opt/docker-compose/bin/docker-compose ~/.docker/cli-plugins/docker-compose
Upvotes: 9
Reputation: 129
The only way I was able to solve this was to completely manually uninstall docker desktop and all docker related items from brew. I deleted every docker file I could find from my lib and then reinstalled.
Upvotes: 1