Commit 5c180e9
committed
#191 Docker Compose support: first sort by compose project and then by name
In 99% of cases container name anyway contains its compose project name.
For example we have a folder wp which has docker-compose.yaml with two services: db and wordpress. Then after docker-compose up container names will be: wp_wordpress_1 and wp_db_1.
But in docker-compose.yaml for a specific service may be explicitly set `container_name` e.g. for wordpress service it may be just "blog".
Or some other container that is not part of compose project may have a similar name like wp_admin.
Then on sorting by name we'll see:
blog <- part of wp compose project
wp_admin <- NOT part of wp compose project
wp_db <- part of wp compose project
To keep container always together on name sorting we'll first sort by compose project and only then by container name inside of the project.
Thus we'll always have:
wp_admin
blog
wp_db
In this case blog and wp_db was sorted separately.1 parent 145ed61 commit 5c180e9
1 file changed
+8
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
22 | | - | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
23 | 30 | | |
24 | 31 | | |
25 | 32 | | |
| |||
0 commit comments