Last active
December 31, 2024 01:15
-
-
Save tatosjb/c477a5c09c4ad8fa67265032831ac94f to your computer and use it in GitHub Desktop.
Create alias for docker compose to docker-compose
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This process establishes an alias for the new docker compose command to ensure compatibility with the previous docker-compose command. | |
sudo touch /usr/bin/docker-compose | |
echo 'docker compose --compatibility "$@"' | sudo tee /usr/bin/docker-compose | |
sudo chmod +x /usr/bin/docker-compose |
It creates a file with
docker compose --compatibility ""
instead ofdocker compose --compatibility "$@"
@bertho-zero
I tested it on zsh, it works fine. I'll change it to echo 'docker compose --compatibility "$@"' | sudo tee /usr/bin/docker-compose2
MacOS version El Capitan and newer the /usr/bin
folder is locked even to root (info). So this should add the alias to /usr/local/bin
instead. I tested and appears to work with my use case of calling docker-compose
from a nodejs (yarn, pnpm, npm, etc) script runner.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It creates a file with
docker compose --compatibility ""
instead ofdocker compose --compatibility "$@"