https://github.com/khalid050/docker-typescript-client
https://github.com/khalid050/docker-typescript-client
docker javascript nodejs typescript
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/khalid050/docker-typescript-client
- Owner: khalid050
- Created: 2022-12-25T07:00:20.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-02-14T00:53:40.000Z (over 3 years ago)
- Last Synced: 2025-02-07T20:22:50.342Z (over 1 year ago)
- Topics: docker, javascript, nodejs, typescript
- Language: TypeScript
- Homepage:
- Size: 254 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
[](https://badge.fury.io/js/@plswork%2Fdocker-typescript-client)
[](https://opensource.org/licenses/MIT)
Getting started
```bash
npm install @plswork/docker-typescript-client
```
```javascript
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"],
});
```