0.1.0 • Published 10 months ago

@repoxcode/docker v0.1.0

Weekly downloads
-
License
SEE LICENSE IN LI...
Repository
github
Last release
10 months ago

DockerSDK

Node.js Docker SDK BETA

📣 BETA Version\ This package is still in BETA, there may still be bugs. Please report any bugs to GitHub


Getting started

Docker SDK adalah alat untuk terhubung dengan Docker engine melalui Node.js. You can use this package on linux or windows operating system.

Package Installation

Installation using NPM

npm i @repoxcode/docker

Installation using Yarn

npm add @repoxcode/docker

Create Object

const dockersdk = new Dockersdk();

// example: get container list
const container = dockersdk.getContainerList();

Setting Socket

Dockersdk has automatically determined the location of your docker socket according to your operating system, but if you have a docker socket location that does not match the default settings, you can determine it using an environment variable, as in the example below.

DOCKERSDK_SOCKET_PATH="socket/location/docker.sock"

Reference

For the time being, you can use the reference to the docker api to define parameters in the SDK, you can adjust the parameters used with the parameters in the SDK.

Container

Returns a list of containers. For details on the format, see the inspect endpoint.

Note that it uses a different, smaller representation of a container than inspecting a single container. For example, the list of linked containers is not propagated.

Image

Returns a list of images on the server. Note that it uses a different, smaller representation of an image than inspecting a single image.

Network

Networks are user-defined networks that containers can be attached to. See the networking documentation for more information.

Volume

Create and manage persistent storage that can be attached to containers.

Exec

Run new commands inside running containers. Refer to the command-line reference for more information. To exec a command in a container, you first need to create an exec instance, then start it. These two API endpoints are wrapped up in a single command-line command, docker exec.

Swarm

Engines can be clustered together in a swarm. Refer to the swarm mode documentation for more information.

Nodes

Nodes are instances of the Engine participating in a swarm. Swarm mode must be enabled for these endpoints to work.

Services

Services are the definitions of tasks to run on a swarm. Swarm mode must be enabled for these endpoints to work.

Tasks

A task is a container running on a swarm. It is the atomic scheduling unit of swarm. Swarm mode must be enabled for these endpoints to work.

Secrets

Secrets are sensitive data that can be used by services. Swarm mode must be enabled for these endpoints to work.

Configs

Configs are application configurations that can be used by services. Swarm mode must be enabled for these endpoints to work.

Plugins

System

Distribution

Session

0.1.0

10 months ago