I was getting acquainted with a new codebase, running tests that required Postgres' PostgresContainer. I needed to change a MacOS setting to enable using the default socket (i.e. /var/run/docker.sock), but for some reason this broke / removed the docker command!
Luckily, the fix was as quick as adding the following to you ~/.zshrc file.

nano ~/.zshrc

path+=/Users/<your_user_name>/.docker/bin
And as with adding anything to your path, a quick source is required:
source /Users/luke/.zshrc