When attempting to install Docker on macOS using Homebrew, you might encounter several conflicts, especially if you've previously installed Docker using a different method. This post details how to resolve these conflicts and ensure a smooth installation process.
Background
Initially, Docker was installed using the regular Homebrew command:
brew install docker
After deciding to switch to Docker Desktop for a more integrated experience, Docker was uninstalled:
brew uninstall docker
Subsequently, the installation was attempted via Homebrew Cask:
brew install --cask docker
This process led to multiple conflicts due to remnants of the previous Docker installations.
Step-by-Step Conflict Resolution
First Conflict: Bash Completion Script
The first error was caused by an existing bash completion script located at /usr/local/etc/bash_completion.d/docker
.
Resolution:
To resolve this, the conflicting file was removed using:
sudo rm /usr/local/etc/bash_completion.d/docker
After clearing the file, the Docker installation was retried.
Second Conflict: ZSH Completion Script
The installation process halted again due to a conflict with a zsh completion file at /usr/local/share/zsh/site-functions/_docker
.
Resolution:
Similarly, the zsh completion file was removed:
sudo rm /usr/local/share/zsh/site-functions/_docker
The Docker installation was attempted once more.
Third Conflict: Fish Completion Script
Another error occurred due to a Fish shell completion file located at /usr/local/share/fish/vendor_completions.d/docker.fish
.
Resolution:
The conflicting Fish completion file was deleted:
sudo rm /usr/local/share/fish/vendor_completions.d/docker.fish
This allowed the Docker installation to complete successfully.
Conclusion
After resolving these conflicts, Docker was successfully installed using Homebrew Cask. This process may seem daunting, but carefully managing and removing conflicting files can solve installation issues. If you face persistent problems, it might be necessary to conduct a more comprehensive cleanup of related files.
This experience underscores the importance of thoroughly removing all components related to previous installations before attempting a new installation, especially when switching installation methods.
Top comments (0)