How to easily install and uninstall docker on MacOs

MacosDocker

Macos Problem Overview


My question is

How to easily install docker to have it available in terminal and how to uninstall docker on osx?

Macos Solutions


Solution 1 - Macos

To Install:

  1. Go Here
  2. Click the "Get Docker" or "Get Docker Desktop for Mac (Stable)" button.
  3. Double-click the DMG
  4. Drag Docker into Applications
  5. Open Docker
  6. Open Terminal after install and docker will be available. Docker should auto-launch on subsequent startups and be available on command line.

To Uninstall:

  1. Click On Docker Icon
  2. Select Preferences
  3. Select Bug Icon for the Troubleshoot menu (Bomb Icon in older Docker UI)
  4. Select Uninstall

An image of Troubleshoot menu that includes Uninstall button

Solution 2 - Macos

Install

To install Docker is easy. Download the .dmg, open it, drag and drop the Docker app to Applications, then run Docker Desktop for Mac. Unfortunately, it sprawls gunk all over your Mac (see uninstall).

Uninstall

If Docker starts, you can use the Docker Desktop app to uninstall. If that doesn't work, you will have to dive into the command line. For a complete uninstall as of 27-Dec-2020, type the following into the terminal:

(Be aware, this removes any Docker virtual machines and images too!)

sudo rm -Rf /Applications/Docker.app
sudo rm -f /usr/local/bin/docker
sudo rm -f /usr/local/bin/docker-machine
sudo rm -f /usr/local/bin/com.docker.cli
sudo rm -f /usr/local/bin/docker-compose
sudo rm -f /usr/local/bin/docker-compose-v1
sudo rm -f /usr/local/bin/docker-credential-desktop
sudo rm -f /usr/local/bin/docker-credential-ecr-login
sudo rm -f /usr/local/bin/docker-credential-osxkeychain
sudo rm -f /usr/local/bin/hub-tool
sudo rm -f /usr/local/bin/hyperkit
sudo rm -f /usr/local/bin/kubectl.docker
sudo rm -f /usr/local/bin/vpnkit
sudo rm -Rf ~/.docker
sudo rm -Rf ~/Library/Containers/com.docker.docker
sudo rm -Rf ~/Library/Application\ Support/Docker\ Desktop
sudo rm -Rf ~/Library/Group\ Containers/group.com.docker
sudo rm -f ~/Library/HTTPStorages/com.docker.docker.binarycookies
sudo rm -f /Library/PrivilegedHelperTools/com.docker.vmnetd
sudo rm -f /Library/LaunchDaemons/com.docker.vmnetd.plist
sudo rm -Rf ~/Library/Logs/Docker\ Desktop
sudo rm -Rf /usr/local/lib/docker
sudo rm -f ~/Library/Preferences/com.docker.docker.plist
sudo rm -Rf ~/Library/Saved\ Application\ State/com.electron.docker-frontend.savedState
sudo rm -f ~/Library/Preferences/com.electron.docker-frontend.plist

Solution 3 - Macos

By command line

INSTALL

Install with

brew install --cask docker

And run docker by

open /Applications/Docker.app

(or by macOs bottom menu> launchpad > docker - on first run docker will ask you about password)

Thats all :)

UNINSTALL

Type brew uninstall --cask docker

  • thats all :)

To clean everything (including images/containers) execute below commands:

sudo rm -Rf /Applications/Docker
sudo rm -f /usr/local/bin/docker
sudo rm -f /usr/local/bin/docker-machine
sudo rm -f /usr/local/bin/docker-compose
sudo rm -f /usr/local/bin/docker-credential-osxkeychain
sudo rm -Rf ~/.docker
sudo rm -Rf $HOME/Library/Containers/com.docker.docker  # here we delete stored images

Solution 4 - Macos

To install: brew install --cask docker

To uninstall: brew uninstall --cask docker

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionKamil KiełczewskiView Question on Stackoverflow
Solution 1 - MacosCynicView Answer on Stackoverflow
Solution 2 - MacosCerniukView Answer on Stackoverflow
Solution 3 - MacosKamil KiełczewskiView Answer on Stackoverflow
Solution 4 - MacostheyCallMeJunView Answer on Stackoverflow