import type { IECRClient } from '../aws'; import type { SubprocessOutputDestination } from './asset-handler'; import type { EventEmitter } from '../progress'; interface BuildOptions { readonly directory: string; /** * Tag the image with a given repoName:tag combination */ readonly tag: string; readonly target?: string; readonly file?: string; readonly buildArgs?: Record; readonly buildContexts?: Record; readonly buildSecrets?: Record; readonly buildSsh?: string; readonly networkMode?: string; readonly platform?: string; readonly outputs?: string[]; readonly cacheFrom?: DockerCacheOption[]; readonly cacheTo?: DockerCacheOption; readonly cacheDisabled?: boolean; } interface PushOptions { readonly tag: string; } export interface DockerCredentialsConfig { readonly version: string; readonly domainCredentials: Record; } export interface DockerDomainCredentials { readonly secretsManagerSecretId?: string; readonly ecrRepository?: string; } export interface DockerCacheOption { readonly type: string; readonly params?: { [key: string]: string; }; } export declare class Docker { private readonly eventEmitter; private readonly subprocessOutputDestination; private configDir; constructor(eventEmitter: EventEmitter, subprocessOutputDestination: SubprocessOutputDestination); /** * Whether an image with the given tag exists */ exists(tag: string): Promise; build(options: BuildOptions): Promise; /** * Get credentials from ECR and run docker login */ login(ecr: IECRClient): Promise; tag(sourceTag: string, targetTag: string): Promise; push(options: PushOptions): Promise; /** * If a CDK Docker Credentials file exists, creates a new Docker config directory. * Sets up `docker-credential-cdk-assets` to be the credential helper for each domain in the CDK config. * All future commands (e.g., `build`, `push`) will use this config. * * See https://docs.docker.com/engine/reference/commandline/login/#credential-helpers for more details on cred helpers. * * @returns true if CDK config was found and configured, false otherwise */ configureCdkCredentials(): boolean; /** * Removes any configured Docker config directory. * All future commands (e.g., `build`, `push`) will use the default config. * * This is useful after calling `configureCdkCredentials` to reset to default credentials. */ resetAuthPlugins(): void; private execute; private cacheOptionToFlag; } export interface DockerFactoryOptions { readonly repoUri: string; readonly ecr: IECRClient; readonly eventEmitter: EventEmitter; readonly subprocessOutputDestination: SubprocessOutputDestination; } /** * Helps get appropriately configured Docker instances during the container * image publishing process. */ export declare class DockerFactory { private enterLoggedInDestinationsCriticalSection; private loggedInDestinations; /** * Gets a Docker instance for building images. */ forBuild(options: DockerFactoryOptions): Promise; /** * Gets a Docker instance for pushing images to ECR. */ forEcrPush(options: DockerFactoryOptions): Promise; private loginOncePerDestination; } export {};