Script to run composer commands in a docker container.
Save the script to any location.
Grant execute permission to scripts.
chmod +x /usr/local/bin/composer-docker.sh
If an existing composer command exists in /usr/local/bin/composer, back it up and rename it.
mv /usr/local/bin/composer /usr/local/bin/composer-backup
Create a symbolic link to composer.
ln -s /usr/local/bin/composer-docker.sh /usr/local/bin/composer
Reflecting changes
source ~/.zshrc