@Generated(value="jsii-pacmak/1.74.0 (build 6d08790)", date="2023-03-22T19:35:34.979Z") public class DockerImage extends BundlingDockerImage
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();
Modifier | Constructor and Description |
---|---|
protected |
DockerImage(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
DockerImage(software.amazon.jsii.JsiiObjectRef objRef) |
|
DockerImage(java.lang.String image,
java.lang.String _imageHash) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
cp(java.lang.String imagePath)
Copies a file or directory out of the Docker image to the local filesystem.
|
java.lang.String |
cp(java.lang.String imagePath,
java.lang.String outputPath)
Copies a file or directory out of the Docker image to the local filesystem.
|
static DockerImage |
fromBuild(java.lang.String path)
Builds a Docker image.
|
static DockerImage |
fromBuild(java.lang.String path,
DockerBuildOptions options)
Builds a Docker image.
|
static DockerImage |
fromRegistry(java.lang.String image)
Reference an image on DockerHub or another online registry.
|
java.lang.String |
getImage()
The Docker image.
|
void |
run()
Runs a Docker image.
|
void |
run(DockerRunOptions options)
Runs a Docker image.
|
java.lang.String |
toJSON()
Provides a stable representation of this image for JSON serialization.
|
fromAsset, fromAsset
protected DockerImage(software.amazon.jsii.JsiiObjectRef objRef)
protected DockerImage(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
public DockerImage(java.lang.String image, java.lang.String _imageHash)
image
- This parameter is required._imageHash
- public static DockerImage fromBuild(java.lang.String path, DockerBuildOptions options)
path
- The path to the directory containing the Docker file. This parameter is required.options
- Docker build options.public static DockerImage fromBuild(java.lang.String path)
path
- The path to the directory containing the Docker file. This parameter is required.public static DockerImage fromRegistry(java.lang.String image)
image
- the image name. This parameter is required.public java.lang.String cp(java.lang.String imagePath, java.lang.String outputPath)
If outputPath
is omitted the destination path is a temporary directory.
cp
in class BundlingDockerImage
imagePath
- the path in the Docker image. This parameter is required.outputPath
- the destination path for the copy operation.public java.lang.String cp(java.lang.String imagePath)
If outputPath
is omitted the destination path is a temporary directory.
cp
in class BundlingDockerImage
imagePath
- the path in the Docker image. This parameter is required.public void run(DockerRunOptions options)
run
in class BundlingDockerImage
options
- public void run()
run
in class BundlingDockerImage
public java.lang.String toJSON()
toJSON
in class BundlingDockerImage
public java.lang.String getImage()
getImage
in class BundlingDockerImage