You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the bash completion script ~/.bash_completion.d/docker a variable COMPOSE_PLUGIN_PATH is being set by running docker info, which is used to setup completion for docker compose. This command fails due to the completion scripts being sourced before the user PATH has been setup.
On Ubuntu 22.04 completion is first sourced from /etc/profile.d/bash_completion.sh before the users .bashrc, and then again from ~/.bash_completion setup by the role. Both of them is being sourced before the PATH set in the Ansible managed block.
This is visible when logging in as the docker user:
# su - docker
-bash: docker: command not found
-bash: docker: command not found
docker@myhost:~$
If I re-order the Ansible managed block in .bashrc, putting it on the top of the file, the second run (sourced from .bashrc) works:
# su - docker
-bash: docker: command not found
docker@myhost:~$
The second sourcing could be fixed by re-ordering the tasks adding to .bashrc, but I'm unsure how to best tackle the first one. Perhaps modifying the completion-script, using some other method to locate the compose plugin.
The text was updated successfully, but these errors were encountered:
In the bash completion script ~/.bash_completion.d/docker a variable COMPOSE_PLUGIN_PATH is being set by running
docker info
, which is used to setup completion fordocker compose
. This command fails due to the completion scripts being sourced before the user PATH has been setup.On Ubuntu 22.04 completion is first sourced from /etc/profile.d/bash_completion.sh before the users .bashrc, and then again from ~/.bash_completion setup by the role. Both of them is being sourced before the PATH set in the Ansible managed block.
This is visible when logging in as the docker user:
If I re-order the Ansible managed block in .bashrc, putting it on the top of the file, the second run (sourced from .bashrc) works:
The second sourcing could be fixed by re-ordering the tasks adding to .bashrc, but I'm unsure how to best tackle the first one. Perhaps modifying the completion-script, using some other method to locate the compose plugin.
The text was updated successfully, but these errors were encountered: