Interface IDockerImageSource
Properties for how to produce a Docker image from a source.
Namespace: Amazon.CDK.CloudAssembly.Schema
Assembly: Amazon.CDK.CloudAssembly.Schema.dll
Syntax (csharp)
public interface IDockerImageSource
Syntax (vb)
Public Interface IDockerImageSource
Remarks
ExampleMetadata: fixture=_generated
Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.CloudAssembly.Schema;
var dockerImageSource = new DockerImageSource {
Directory = "directory",
DockerBuildArgs = new Dictionary<string, string> {
{ "dockerBuildArgsKey", "dockerBuildArgs" }
},
DockerBuildTarget = "dockerBuildTarget",
DockerFile = "dockerFile",
Executable = new [] { "executable" },
NetworkMode = "networkMode",
Platform = "platform"
};
Synopsis
Properties
Directory | The directory containing the Docker image build instructions. |
DockerBuildArgs | Additional build arguments. |
DockerBuildTarget | Target build stage in a Dockerfile with multiple build stages. |
DockerFile | The name of the file with build instructions. |
Executable | A command-line executable that returns the name of a local Docker image on stdout after being run. |
NetworkMode | Networking mode for the RUN commands during build. Requires Docker Engine API v1.25+. |
Platform | Platform to build for. Requires Docker Buildx. |
Properties
Directory
The directory containing the Docker image build instructions.
virtual string Directory { get; }
Property Value
System.String
Remarks
This path is relative to the asset manifest location.
Default: - Exactly one of directory
and executable
is required
DockerBuildArgs
Additional build arguments.
virtual IDictionary<string, string> DockerBuildArgs { get; }
Property Value
System.Collections.Generic.IDictionary<System.String, System.String>
Remarks
Only allowed when directory
is set.
Default: - No additional build arguments
DockerBuildTarget
Target build stage in a Dockerfile with multiple build stages.
virtual string DockerBuildTarget { get; }
Property Value
System.String
Remarks
Only allowed when directory
is set.
Default: - The last stage in the Dockerfile
DockerFile
The name of the file with build instructions.
virtual string DockerFile { get; }
Property Value
System.String
Remarks
Only allowed when directory
is set.
Default: "Dockerfile"
Executable
A command-line executable that returns the name of a local Docker image on stdout after being run.
virtual string[] Executable { get; }
Property Value
System.String[]
Remarks
Default: - Exactly one of directory
and executable
is required
NetworkMode
Networking mode for the RUN commands during build. Requires Docker Engine API v1.25+.
virtual string NetworkMode { get; }
Property Value
System.String
Remarks
Specify this property to build images on a specific networking mode.
Default: - no networking mode specified
Platform
Platform to build for. Requires Docker Buildx.
virtual string Platform { get; }
Property Value
System.String
Remarks
Specify this property to build images on a specific platform/architecture.
Default: - current machine platform