0.0.9 • Published 5 years ago

simple-dockerjs v0.0.9

Weekly downloads
3
License
MIT
Repository
github
Last release
5 years ago

view on npm npm module downloads dependencies Status

simple-dockerjs

Simple DockerJS is suppose to be an simple docker utilitary for to use with javascript.

Install

$ npm install simple-dockerjs --save

Container

To execute container related command, you need to use the container module. You can get the container module like this:

const { container } = require("simple-dockerjs")

ls

List docker containers - used with the container.ls() function.

USAGE: container.ls('-any -param -you -want')

DOCKER COMMAND: docker container ls -any -param -you -want

Listing containers

const { container } = require("simple-dockerjs")
console.log(container.ls())

output:

[
  Container {
    id: 'cb7148ae8e4e',
    names: 'some-rabbit',
    image: 'rabbitmq:3',
    ports: '4369/tcp, 5671-5672/tcp, 25672/tcp'
  }
]

Listing containers with params

const { container } = require("simple-dockerjs")
console.log(container.ls('-a'))

output:

[
  Container {
    id: 'cb7148ae8e4e',
    names: 'some-rabbit',
    image: 'rabbitmq:3',
    ports: '4369/tcp, 5671-5672/tcp, 25672/tcp'
  },
  Container {
    id: '17f385992a62',
    names: 'some-redis',
    image: 'redis',
    ports: '6379/tcp'
  }
]

Image

To execute image related command, you need to use the image module. You can get the image module like this:

const { image } = require("simple-dockerjs")

ls

List docker image - used with the image.ls() function.

USAGE: image.ls('-any -param -you -want')

DOCKER COMMAND: docker image ls -any -param -you -want

Listing images

const { image } = require("simple-dockerjs")
console.log(image.ls())

output:

[
  Image { imageId: 'c313149f36a4', repository: 'rabbitmq', tag: '3' },
  Image { imageId: '857c4ab5f029', repository: 'redis', tag: 'latest' }
]

Listing images with params

const { container } = require("simple-dockerjs")
console.log(container.ls('--filter=reference=redis'))

output:

[
  Image { imageId: '857c4ab5f029', repository: 'redis', tag: 'latest' }
]

Inspect

To execute inspect related command, you need to use the inspect module. You can get the inspect module like this:

const { inspect } = require("simple-dockerjs")

inspect

Inspect docker objects - used with the inspect.inspect() function.

USAGE: inspect.inspect('object_id')

DOCKER COMMAND: docker inspect {{object_id}}

Inspecting container

const { inspect } = require("simple-dockerjs")
console.log(inspect.inspect('cb7148ae8e4e'))

output

Inspect { id: 'cb7148ae8e4e', running: true }
0.0.9

5 years ago

0.0.8

5 years ago

0.0.7

5 years ago

0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago