1.0.1 • Published 2 years ago

@plswork/docker-typescript-client v1.0.1

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

npm version License: MIT

npm install @plswork/docker-typescript-client
const { Docker } = require("@plswork/docker-typescript-client");

const { Container, Image } = new Docker();
/**
 *  Defaults:
 *    url: "http://localhost/v1.41/"
 *    socketPath: "/var/run/docker.sock"
 */

// Override defaults
const { Container, Image } = new Docker({
  url: my_url,
  socketPath: my_socket_path,
});

// examples
await Image.build("path/to/dockerfile", {
  t: myubuntuimage,
});

const myContainer = await Container.create({
  containerName: "mynewcontainer",
  defaultCommand: ["echo", "hello"],
});