AgustinCB / docker-api

Docker Remote API driver for node.js. It uses the same modem than dockerode, but the interface is promisified and with a fancier syntax.
GNU General Public License v3.0
303 stars 51 forks source link

How to get a name of a container? #60

Closed mushketyk closed 3 years ago

mushketyk commented 5 years ago

Could you please add a code snippet that shows how to get a name of a running container and related information?

kristinashalava commented 4 years ago
docker.container.list()
                .then(containers => {
                    containers.forEach(container => {
                            console.log(container.data.Names)
                    });
                })
                .catch(error => {
                    console.log(error);
                });