froq-docker
froq-docker
is partially implemented according to Docker Engine 1.37. This still a WIP project and there is a lot to do. We also tried to give the same name as in the docker API, so some attributes are just called t
, but you can easily find them in the docs.
Usage
npm install froq-docker
We use npm package debug
. To make me verbose use DEBUG=froq-docker
.
Create Docker
At current we only support socket file.
;const docker = Docker;
Start Container
const image = await docker; const container = await image;await containerstart; const inspection = await container;const address = inspection; // open browser with `address`
Build Image
// it should contain:// 1. Dockerfile// 2. all resources reference in Dockerfileconst buildTar = 'build.tar.gz'; // stats from tar fileconst stats = await ; // create read stream for tar fileconst writeStream = fs; // build imageconst image = await docker; // use itconst container = await image;
Cleanup Container
await container;await container;await container;
Cleanup Image
await image;
List all Containers
const containers = await docker;
List all Images
const images = await docker;
Attach Container
await container;
Exec Container
const exec = await container; await execstart Detach: false Tty: true { duplexout; duplex;};
Tests
To get a better understanding, also read the Tests