Dockerode: [Issue] Docker listContainer with filter doesn't work

Created on 21 Apr 2017  路  1Comment  路  Source: apocas/dockerode

Hi,
Maybe I'm doing something wrong but it looks like listContainers doesn't work with filter..

that's my code:

docker.listContainers({ filters: { "Id": "b7fc8d75b36f2f0d25a4677821b962fe16fbbf94883e5ab9901bdafffb9d30c3", "Names":"alertmanager" } }, Meteor.bindEnvironment(function(err, containers) {
    if (containers != null) {
        console.log(containers);
        containers.forEach(Meteor.bindEnvironment(function(containerInfo) {
            if(containerInfo.Names[0].startsWith("/")){
               containerInfo.Names[0] = containerInfo.Names[0].substr(1);
               console.log( containerInfo.Names[0]);
            }
        }));
    }else{
      if(err){
        console.error(err);
      }
      console.log("containers: ");
      console.log(containers);
    }
  }));

so it's very basic I want for example list the name alertmanager but it list me all the containers. Even the object contianers contains all the containers that I have .

any ideas of what creates this problem ?

Most helpful comment

It's ok to make it works we need to put the id between []

>All comments

It's ok to make it works we need to put the id between []

Was this page helpful?
0 / 5 - 0 ratings

Related issues

controversial picture controversial  路  3Comments

mhemrg picture mhemrg  路  4Comments

knight42 picture knight42  路  6Comments

hackhat picture hackhat  路  4Comments

peterpetre picture peterpetre  路  6Comments