-
Notifications
You must be signed in to change notification settings - Fork 612
Sort containers by Labels.com.docker.compose.container-number
#679
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
It's being sorted lexicographically (as strings), which causes "10" to come before "2" (because "1" < "2"). Could you pad the container numbers labels with a 0? So 1 becomes 01, 2 becomes 02 and so on. |
@AkramiPro that's actually a bug, docker-gen treat the full string passed to In other words {
"Labels": {
"com": {
"docker":{
"compose": {
"container_number": 1
}
}
}
}
} While in reality you have: {
"Labels": {
"com.docker.compose.container_number": 1
}
} |
@AkramiPro I've got a fix Edit: I got that fixed too. |
@buchdag thanks for fixing ❤️🙏 |
@AkramiPro could you test the |
yes it works
|
Thank you for the great work on docker-gen.
I want to sort my containers using
container-number
, but I think this is not supported yet, or I might be doing it wrong.sort by
Labels.com.docker.compose.container-number
result:
sort by
Name
result:
The text was updated successfully, but these errors were encountered: