Closed jerrylopez closed 5 years ago
Yeah, it appears that on narrow window docker-compose ps
command returns a table with multiline text in columns. After that, grep
fetches the line what includes search query and in result, not complete container's name.
Thanks a lot for your contribution @jerrylopez !
When using the
bin
scripts I noticed that sometimes the commands worked and sometimes they would throw an error like this:In this situation, my directory name is
docker-magento-231
and the container's name isdocker-magento-231_phpfpm_1
. Weirdly enough anything from the first-
and before is being omitted from the docker commands. I found that the width of the terminal window was actually affecting this.Example If the window was wide enough the docker commands run just fine because the container name is correct
If the window is too narrow the container name is trimmed because the docker-compose name output is multi-lined
I found that the issue lies when grep is used to retrieve the container name. I tested out
grep
in a different scenario and it doesn't seem to be the cause of the issue. A co-worker actually mentioned that this could have something to do withdocker-compose
and how the data is piped.I didn't dig too much into the situation because I went the route of using the container id instead for the
docker
commands.