Package software.amazon.awscdk.core
Class DockerImage
java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.core.BundlingDockerImage
software.amazon.awscdk.core.DockerImage
- All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable
@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)",
date="2023-06-19T16:29:55.023Z")
@Stability(Stable)
public class DockerImage
extends BundlingDockerImage
A Docker image.
Example:
String entry = "/path/to/function"; DockerImage image = DockerImage.fromBuild(entry); PythonFunction.Builder.create(this, "function") .entry(entry) .runtime(Runtime.PYTHON_3_8) .bundling(BundlingOptions.builder() .buildArgs(Map.of("PIP_INDEX_URL", "https://your.index.url/simple/", "PIP_EXTRA_INDEX_URL", "https://your.extra-index.url/simple/")) .build()) .build();
-
Nested Class Summary
Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
-
Constructor Summary
ModifierConstructorDescriptionDockerImage
(String image) DockerImage
(String image, String _imageHash) protected
DockerImage
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
DockerImage
(software.amazon.jsii.JsiiObjectRef objRef) -
Method Summary
Modifier and TypeMethodDescriptionCopies a file or directory out of the Docker image to the local filesystem.Copies a file or directory out of the Docker image to the local filesystem.static DockerImage
Builds a Docker image.static DockerImage
fromBuild
(String path, DockerBuildOptions options) Builds a Docker image.static DockerImage
fromRegistry
(String image) Reference an image on DockerHub or another online registry.getImage()
The Docker image.void
run()
Runs a Docker image.void
run
(DockerRunOptions options) Runs a Docker image.toJSON()
Provides a stable representation of this image for JSON serialization.Methods inherited from class software.amazon.awscdk.core.BundlingDockerImage
fromAsset, fromAsset
Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Constructor Details
-
DockerImage
protected DockerImage(software.amazon.jsii.JsiiObjectRef objRef) -
DockerImage
protected DockerImage(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
DockerImage
- Parameters:
image
- This parameter is required._imageHash
-
-
DockerImage
- Parameters:
image
- This parameter is required.
-
-
Method Details
-
fromBuild
@Stability(Stable) @NotNull public static DockerImage fromBuild(@NotNull String path, @Nullable DockerBuildOptions options) Builds a Docker image.- Parameters:
path
- The path to the directory containing the Docker file. This parameter is required.options
- Docker build options.
-
fromBuild
Builds a Docker image.- Parameters:
path
- The path to the directory containing the Docker file. This parameter is required.
-
fromRegistry
Reference an image on DockerHub or another online registry.- Parameters:
image
- the image name. This parameter is required.
-
cp
@Stability(Stable) @NotNull public String cp(@NotNull String imagePath, @Nullable String outputPath) 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.- Overrides:
cp
in classBundlingDockerImage
- Parameters:
imagePath
- the path in the Docker image. This parameter is required.outputPath
- the destination path for the copy operation.- Returns:
- the destination path
-
cp
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.- Overrides:
cp
in classBundlingDockerImage
- Parameters:
imagePath
- the path in the Docker image. This parameter is required.- Returns:
- the destination path
-
run
Runs a Docker image.- Overrides:
run
in classBundlingDockerImage
- Parameters:
options
-
-
run
@Stability(Stable) public void run()Runs a Docker image.- Overrides:
run
in classBundlingDockerImage
-
toJSON
Provides a stable representation of this image for JSON serialization.- Overrides:
toJSON
in classBundlingDockerImage
- Returns:
- The overridden image name if set or image hash name in that order
-
getImage
The Docker image.- Overrides:
getImage
in classBundlingDockerImage
-