@apiclient.xyz/docker
Version:
Provides easy communication with Docker remote API from Node.js, with TypeScript support.
80 lines (79 loc) • 2.68 kB
TypeScript
import * as plugins from './plugins.js';
import * as interfaces from './interfaces/index.js';
import { DockerHost } from './classes.host.js';
import { DockerResource } from './classes.base.js';
/**
* represents a docker image on the remote docker host
*/
export declare class DockerImage extends DockerResource {
/**
* Internal: Get all images
* Public API: Use dockerHost.listImages() instead
*/
static _list(dockerHost: DockerHost): Promise<DockerImage[]>;
/**
* Internal: Get image by name
* Public API: Use dockerHost.getImageByName(name) instead
*/
static _fromName(dockerHost: DockerHost, imageNameArg: string): Promise<DockerImage | undefined>;
/**
* Internal: Create image from registry
* Public API: Use dockerHost.createImageFromRegistry(descriptor) instead
*/
static _createFromRegistry(dockerHostArg: DockerHost, optionsArg: {
creationObject: interfaces.IImageCreationDescriptor;
}): Promise<DockerImage>;
/**
* Internal: Create image from tar stream
* Public API: Use dockerHost.createImageFromTarStream(stream, descriptor) instead
*/
static _createFromTarStream(dockerHostArg: DockerHost, optionsArg: {
creationObject: interfaces.IImageCreationDescriptor;
tarStream: plugins.smartstream.stream.Readable;
}): Promise<DockerImage>;
static tagImageByIdOrName(dockerHost: DockerHost, idOrNameArg: string, newTagArg: string): Promise<void>;
/**
* Internal: Build image from Dockerfile
* Public API: Use dockerHost.buildImage(tag) instead
*/
static _build(dockerHostArg: DockerHost, dockerImageTag: any): Promise<void>;
/**
* the tags for an image
*/
Containers: number;
Created: number;
Id: string;
Labels: interfaces.TLabels;
ParentId: string;
RepoDigests: string[];
RepoTags: string[];
SharedSize: number;
Size: number;
VirtualSize: number;
constructor(dockerHostArg: DockerHost, dockerImageObjectArg: any);
/**
* Refreshes this image's state from the Docker daemon
*/
refresh(): Promise<void>;
/**
* tag an image
* @param newTag
*/
tagImage(newTag: any): Promise<void>;
/**
* pulls the latest version from the registry
*/
pullLatestImageFromRegistry(): Promise<boolean>;
/**
* Removes this image from the Docker daemon
*/
remove(options?: {
force?: boolean;
noprune?: boolean;
}): Promise<void>;
getVersion(): Promise<string>;
/**
* exports an image to a tar ball
*/
exportToTarStream(): Promise<plugins.smartstream.stream.Readable>;
}