I installed docker-compose, set up auto completion which works as its supposed to. However it does not work on aliases.

Any ideas how to solve this?


For bash just do:

Get the configuration from the official project:

sudo curl -L https://raw.githubusercontent.com/docker/compose/1.23.2/contrib/completion/bash/docker-compose -o /etc/bash_completion.d/docker-compose


Reset the terminal to be sure new configuration are load.



Once the file is installed as before, open it whit your favorite text editor go to the end of file and append your alias to this line:

complete -F _docker_compose docker-compose docker-compose.exe

so after the modification it will be:

complete -F _docker_compose docker-compose docker-compose.exe *yoralias*

NOTE: be careful with the alias you choose, you could use a name of existing command (I.E. dc exist as a command Read here)

  • I did this and it works but what I want is to work on an alias. I set up an alias to use dc instead of docker-compose to save some writing and when I use the alias auto completion stops working. – Mirt Hlaj Jan 14 at 20:43
  • ok, i get it, I'll update my answer in a minut – AtomiX84 Jan 14 at 20:55

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.