Check if Docker is already installed.
docker ps
Install Rosetta, a necessary component for Docker.
softwareupdate --install-rosetta
Check if Docker.dmg file exists.
ls Docker.dmg
Mount the Docker.dmg disk image.
sudo hdiutil attach Docker.dmg
Run the Docker installation.
sudo /Volumes/Docker/Docker.app/Contents/MacOS/install
Unmount the Docker.dmg disk image.
sudo hdiutil detach /Volumes/Docker
Verify Docker installation.
docker ps
Reload the shell configuration.
source ~/.zshrc
Verify Docker path.
which docker