I hope someone will be able to help me. I'm using Dockerode to make actions on my Docker containers via JavaScript.
I have some hard times to get the name of a single container. The request is "get the name of the container who has the id XXX" but I can't make it works.
To do that I used listContainers
and I tried to play with the options:
docker.listContainers({id: idContainer}, Meteor.bindEnvironment(function(err, containers) {
if (containers != null) {
containers.forEach(Meteor.bindEnvironment(function(containerInfo) {
if(containerInfo.Names[0].startsWith("/")){
containerInfo.Names[0] = containerInfo.Names[0].substr(1);
console.log( containerInfo.Names[0]);
}
}));
}
}));
where idContainer is the id of a known container
But the output contains the name of ALL containers.
I really hope someone can help me