0.0.3 • Published 7 months ago

docker-bowline v0.0.3

Weekly downloads
-
License
ISC
Repository
github
Last release
7 months ago

docker-bowline

A simple library for sending requests to docker engine over sockets.

Disclaimer

This library only includes the aspects of docker engine that I have needed for my projects.

Getting started

Install

npm i docker-bowline

Setup

import {Docker} from 'docker-bowline';


const windowsSocket = new Docker({
	socket: "//./pipe/docker_engine"
});

const unixSocket = new Docker({
	socket: "/var/run/docker.sock"
});

Basic usage

const docker = new Docker({socket: "/var/run/docker.sock"});

// Create container won`t auto pull a missing container.
await docker.images.pull("mongo:latest");

const container = await docker.containers.create(
	"test-mongo",
	{
		Image: "mongo"
	}
);

await docker.containers.start(container.Id);

const inspectContainerResponse = await docker.containers.inspect(container.Id);

await docker.containers.stop(container.Id);

await docker.containers.delete(container.Id);
0.0.3

7 months ago

0.0.2

7 months ago

0.0.1

7 months ago