49

I installed docker-compose by following the official documentation: http://docs.docker.com/compose/install/

Now I want to uninstall docker-compose.

$ docker-compose -h

offers no command for uninstalling, nor does the official documentation offer any instructions.

I deleted my docker-compose.yml file and /usr/local/bin/docker-compose, but I want to make sure that's everything.

I'm using OSX Yosemite 10.10.3 on a MacbookPro.

EDIT: Regarding the installation instructions I followed, I didn't use pip. I used the documented curl command:

$ curl -L https://github.com/docker/compose/releases/download/1.3.1/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
$ chmod +x /usr/local/bin/docker-compose
mycargus
  • 2,538
  • 3
  • 23
  • 31
  • `sudo find / -name "*docker-compose*" -exec rm -r {} \;` or to test run just add `echo`.. `sudo find / -name "*docker-compose*" -exec echo rm -r {} \;` – davidcondrey Feb 12 '16 at 22:32
  • @davidcondrey or just `-delete`... – Boris the Spider Sep 05 '18 at 20:19
  • Why would you want to do that? It would only delete your local instance of Docker Compose, which comes packaged with a Docker installation. – ryanwebjackson May 23 '23 at 14:07
  • @ryanwebjackson In 2015 Docker Desktop didn't exist; docker, docker-compose, and docker-engine were each installed separately. Today I imagine most Mac folks install Docker Desktop. On Linux it's possible to remove the docker compose plugin and keep the rest. See https://docs.docker.com/compose/install/uninstall/ – mycargus Jun 01 '23 at 18:26
  • My point is that you're only affecting one machine by deleting it. What is the purpose of doing so? – ryanwebjackson Jun 02 '23 at 12:19
  • If I recall at the time I wanted a fresh installation of all docker tools on the single Mac I was using. I don't understand what you mean about only affecting one machine. I must be missing something in your question. – mycargus Jun 02 '23 at 22:34

6 Answers6

90

Documenation

Please note that this is now in the docs.

Coupled Installation and Removal

Note: on Mac Docker now installs Docker Compose. So the strategy for removal has changed a bit. If you uninstall Docker, and you want to uninstall both, then you also uninstall Docker Compose.

Individual Removal if Installed Using curl

It is commonly installed to /usr/local/bin/docker-compose on macs. However, you can run which docker-compose to find the exact location.

Run the following command (*nix systems) to remove:

rm $(which docker-compose)

If you get a permission denied error then you will need to prepend sudo:

sudo rm $(which docker-compose)

To verify that it was successful, run the following command which should return nothing:

which docker-compose

It should say that the command wasn't found.

Individual Removal if Installed Using PIP

If you've installed Docker Compose using PIP then you can run:

pip uninstall docker-compose

You may have to use sudo if you get a permission denied error:

sudo pip uninstall docker-compose
CommandZ
  • 3,333
  • 1
  • 23
  • 28
  • 2
    I sent a PR to the Docker Compose documentation to update it with my answer. It will show up here after a bit: https://docs.docker.com/compose/install/ This was the PR: https://github.com/docker/compose/pull/1619/files – CommandZ Jul 02 '15 at 18:38
20

first get docker path by:

which docker-compose

then it will return path like:/usr/bin/docker-compose

then remove it:

sudo rm -rf /usr/bin/docker-compose

Eslam Saber
  • 509
  • 5
  • 11
3

Nowadays docker-compose is part of the docker toolbox.
If you want to remove everything that comes with the Docker Toolbox (including Docker itself).

You can execute this shell script:

#!/bin/bash

# Uninstall Script

if [ "${USER}" != "root" ]; then
    echo "$0 must be run as root!"
    exit 2
fi

while true; do
  read -p "Remove all Docker Machine VMs? (Y/N): " yn
  case $yn in
    [Yy]* ) docker-machine rm -f $(docker-machine ls -q); break;;
    [Nn]* ) break;;
    * ) echo "Please answer yes or no."; exit 1;;
  esac
done

echo "Removing Applications..."
rm -rf /Applications/Docker

echo "Removing docker binaries..."
rm -f /usr/local/bin/docker
rm -f /usr/local/bin/docker-machine
rm -r /usr/local/bin/docker-machine-driver*
rm -f /usr/local/bin/docker-compose

echo "Removing boot2docker.iso"
rm -rf /usr/local/share/boot2docker

echo "All Done!"

If you still have the depreciated Boot2docker and you want to get rid of it as well.

You can uninstall it by executing the following shell script:

#!/bin/bash

# Uninstall Script

if [ "$(which boot2docker)" == "" ]; then
    echo "boot2docker does not exist on your machine!"
    exit 1
fi

if [ "${USER}" != "root" ]; then
    echo "$0 must be run as root!"
    exit 2
fi

echo "Stopping boot2docker processes..."
boot2docker stop && boot2docker delete

echo "Removing boot2docker executable..."
rm -f /usr/local/bin/boot2docker

echo "Removing boot2docker ISO and socket files..."
rm -rf ~/.boot2docker
rm -rf /usr/local/share/boot2docker

echo "Removing boot2docker SSH keys..."
rm -f ~/.ssh/id_boot2docker*

echo "Removing boot2docker OSX files..."
rm -f /private/var/db/receipts/io.boot2docker.*
rm -f /private/var/db/receipts/io.boot2dockeriso.*

echo "Removing Docker executable..."
rm -f /usr/local/bin/docker

echo "All Done!"
Mahmoud Zalt
  • 30,478
  • 7
  • 87
  • 83
0

You can also just:

 sudo yum remove docker-compose-plugin

on RPM-based like Centos

according to: https://docs.docker.com/compose/install/uninstall/

-1

i saw this mistake when i was run ansible-playbook FAILED! => {"changed": false, "msg": "Unable to load docker-compose. Try pip install docker-compose for ubuntu, me help. Docker-compose not installed because pip3 not upgrade, after i will do

pip3 install setuptools-rust
pip3 install --upgrade pip
pip3 install docker-compose

its work for me

john doo
  • 1
  • 1
  • 1
    `pip3 install docker-compose` won't uninstall anything. Please add some more explanation to your answer such that others can learn from it – Nico Haase May 23 '23 at 13:08
-2

I would use pip uninstall docker-compose

Paul Becotte
  • 9,767
  • 3
  • 34
  • 42
  • Thank you for the suggestion, but I didn't use pip to install. Edited my question now. – mycargus Jun 22 '15 at 20:12
  • 1
    I didn't realize that was their installation method. In that case, then your solution should be complete. – Paul Becotte Jun 22 '15 at 20:53
  • Can you think of a way to verify whether it was successful? I wouldn't expect any other files to be created during install, but this is precisely what I want to confirm or disprove. :) – mycargus Jun 22 '15 at 23:19
  • to verify installation run `docker-compose -v` – CommandZ Jun 30 '15 at 16:16