@muirglacier/testcontainers
Version:
A collection of TypeScript + JavaScript tools and libraries for DeFi Blockchain developers to build decentralized finance for Bitcoin
37 lines • 1.13 kB
TypeScript
import Dockerode, { Container, DockerOptions } from 'dockerode';
export declare abstract class DockerContainer {
protected readonly image: string;
protected readonly docker: Dockerode;
protected container?: Container;
protected constructor(image: string, options?: DockerOptions);
get id(): string;
getIp(name?: string): Promise<string>;
/**
* Try pull docker image if it doesn't already exist.
*/
protected tryPullImage(): Promise<void>;
/**
* Require container, else error exceptionally.
* Not a clean design, but it keep the complexity of this implementation low.
*/
protected requireContainer(): Container;
/**
* Get host machine port
*
* @param {string} name of ExposedPorts e.g. '80/tcp'
*/
getPort(name: string): Promise<string>;
/**
* tty into docker
*/
exec(opts: {
Cmd: string[];
}): Promise<void>;
/**
* Inspect docker container info
*
* @return {Promise<Record<string, any>>}
*/
inspect(): Promise<Record<string, any>>;
}
//# sourceMappingURL=DockerContainer.d.ts.map