New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

dockercmd

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dockercmd

Use docker functions in your javascript code

latest
Source
npmnpm
Version
0.0.1
Version published
Maintainers
1
Created
Source

dockercmd

Use docker functions in your javascript code

Installation

$ npm install dockercmd

Usage

var dockercmd = require( 'dockercmd' );

Containers list

dockercmd.ps().then(result => {
    console.log(result);
});

Return exemple :

[
   {
      "id":"a5d55b5c3ebe",
      "port":"",
      "image":"hello-world",
      "created":"2017-07-24 11:56:50 +0200 CEST",
      "status":"Exited (0) About an hour ago"
   },
   {
      "id":"734121f89a41",
      "port":"",
      "image":"postgres:9.6-alpine",
      "created":"2017-07-19 16:29:23 +0200 CEST",
      "status":"Exited (0) About an hour ago"
   }
]

Images list

dockercmd.images().then(result => {
    console.log(result);
});

Return exemple :

[
   {
      "id":"f6a9a3968e52",
      "repository":"postgres",
      "tag":"9.6-alpine",
      "size":"37.7 MB",
      "created":"2017-07-15 00:58:03 +0200 CEST"
   },
   {
      "id":"1815c82652c0",
      "repository":"hello-world",
      "tag":"latest",
      "size":"1.84 kB",
      "created":"2017-06-14 21:29:01 +0200 CEST"
   }{
      "id":"8a0824e0a178",
      "repository":"docker.elastic.co/elasticsearch/elasticsearch",
      "tag":"5.4.1",
      "size":"519 MB",
      "created":"2017-06-01 16:43:22 +0200 CEST"
   }
]

Container stats

dockercmd.stats(container_id).then(result => {
    console.log(result);
});

Return exemple :

{
   "container_id":"734121f89a41",
   "cpu_perc":"0.04%",
   "mem_usage":{
      "used":"12.15 MiB",
      "limit":"15.56 GiB"
   },
   "mem_perc":"0.08%",
   "net_io":{
      "in":"0 B",
      "out":"0 B"
   },
   "block_io":{
      "in":"0 B",
      "out":"90.1 kB"
   }
}

Start container

dockercmd.start(container_id).then(result => {
    console.log(result);
});

Stop container

dockercmd.stop(container_id).then(result => {
    console.log(result);
});

Remove container

dockercmd.rm(container_id).then(result => {
    console.log(result);
});

Remove image

dockercmd.rmi(image_id).then(result => {
    console.log(result);
});

License

MIT license.

Keywords

docker

FAQs

Package last updated on 25 Jul 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts