Skip to content

DockerImage

A Docker image.

Initializers

import { DockerImage } from '@alicloud/ros-cdk-core'
new DockerImage(image: string, _imageHash?: string)
Name Type Description
image string No description.
_imageHash string No description.

imageRequired

  • Type: string

_imageHashOptional

  • Type: string

Methods

Name Description
cp Copies a file or directory out of the Docker image to the local filesystem.
run Runs a Docker image.
toJSON Provides a stable representation of this image for JSON serialization.

cp

public cp(imagePath: string, outputPath?: string): string

Copies a file or directory out of the Docker image to the local filesystem.

If outputPath is omitted the destination path is a temporary directory.

imagePathRequired

  • Type: string

the path in the Docker image.


outputPathOptional

  • Type: string

the destination path for the copy operation.


run

public run(options?: DockerRunOptions): void

Runs a Docker image.

optionsOptional


toJSON

public toJSON(): string

Provides a stable representation of this image for JSON serialization.

Static Functions

Name Description
fromBuild Builds a Docker image.
fromRegistry Reference an image on DockerHub or another online registry.

fromBuild

import { DockerImage } from '@alicloud/ros-cdk-core'
DockerImage.fromBuild(path: string, options?: DockerBuildOptions)

Builds a Docker image.

pathRequired

  • Type: string

The path to the directory containing the Docker file.


optionsOptional

Docker build options.


fromRegistry

import { DockerImage } from '@alicloud/ros-cdk-core'
DockerImage.fromRegistry(image: string)

Reference an image on DockerHub or another online registry.

imageRequired

  • Type: string

the image name.


Properties

Name Type Description
image string No description.

imageRequired

public readonly image: string;
  • Type: string