I'm running docker 1.12.1 and can't get node filtering by label to work. I first add the "test" label:
$ docker node update --label-add test mr-host
mr-host
When I attempt to filter by it, no nodes are shown:
$ docker node ls --filter label=test
ID HOSTNAME STATUS AVAILABILITY MANAGER STATUS
Filtering by other criteria such as name works fine:
$ docker node ls --filter name=mr-host
ID HOSTNAME STATUS AVAILABILITY MANAGER STATUS
1c48m4msidbqwx7vj0lwib8ef * mr-host Ready Active Leader
The label is shown when I inspect the node:
$ docker node inspect mr-host
[
{
"ID": "1c48m4msidbqwx7vj0lwib8ef",
"Version": {
"Index": 4865874
},
"CreatedAt": "2016-10-12T15:20:10.463286132Z",
"UpdatedAt": "2016-10-13T16:29:03.113522485Z",
"Spec": {
"Labels": {
"test": ""
},
"Role": "manager",
"Availability": "active"
},
"Description": {
"Hostname": "mr-host",
"Platform": {
"Architecture": "x86_64",
"OS": "linux"
},
"Resources": {
"NanoCPUs": 10000000000,
"MemoryBytes": 67548012544
},
"Engine": {
"EngineVersion": "1.12.1",
"Plugins": [
{
"Type": "Network",
"Name": "bridge"
},
{
"Type": "Network",
"Name": "host"
},
{
"Type": "Network",
"Name": "null"
},
{
"Type": "Network",
"Name": "overlay"
},
{
"Type": "Volume",
"Name": "local"
}
]
}
},
"Status": {
"State": "ready"
},
"ManagerStatus": {
"Leader": true,
"Reachability": "reachable",
"Addr": "192.168.0.118:2377"
}
}
]
What am I doing wrong? I'm pretty sure I've followed the documentation here correctly: https://docs.docker.com/engine/reference/commandline/node_ls/#/id