DockerImageSource Struct
Properties for how to produce a Docker image from a source.
| Source | lib/assets/docker-image-asset.ts |
|---|---|
| Type last changed |
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { cloud_assembly_schema } from 'aws-cdk-lib';
const dockerImageSource: cloud_assembly_schema.DockerImageSource = {
cacheDisabled: false,
cacheFrom: [{
type: 'type',
// the properties below are optional
params: {
paramsKey: 'params',
},
}],
cacheTo: {
type: 'type',
// the properties below are optional
params: {
paramsKey: 'params',
},
},
directory: 'directory',
dockerBuildArgs: {
dockerBuildArgsKey: 'dockerBuildArgs',
},
dockerBuildContexts: {
dockerBuildContextsKey: 'dockerBuildContexts',
},
dockerBuildSecrets: {
dockerBuildSecretsKey: 'dockerBuildSecrets',
},
dockerBuildSsh: 'dockerBuildSsh',
dockerBuildTarget: 'dockerBuildTarget',
dockerFile: 'dockerFile',
dockerOutputs: ['dockerOutputs'],
executable: ['executable'],
networkMode: 'networkMode',
platform: 'platform',
};
from aws_cdk.cloud_assembly_schema import DockerImageSource, DockerCacheOption, DockerCacheOption
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import cloud_assembly_schema
docker_image_source = DockerImageSource(
cache_disabled=False,
cache_from=[DockerCacheOption(
type="type",
# the properties below are optional
params={
"params_key": "params"
}
)],
cache_to=DockerCacheOption(
type="type",
# the properties below are optional
params={
"params_key": "params"
}
),
directory="directory",
docker_build_args={
"docker_build_args_key": "dockerBuildArgs"
},
docker_build_contexts={
"docker_build_contexts_key": "dockerBuildContexts"
},
docker_build_secrets={
"docker_build_secrets_key": "dockerBuildSecrets"
},
docker_build_ssh="dockerBuildSsh",
docker_build_target="dockerBuildTarget",
docker_file="dockerFile",
docker_outputs=["dockerOutputs"],
executable=["executable"],
network_mode="networkMode",
platform="platform"
)
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.cloud_assembly_schema.*;
DockerImageSource dockerImageSource = DockerImageSource.builder()
.cacheDisabled(false)
.cacheFrom(List.of(DockerCacheOption.builder()
.type("type")
// the properties below are optional
.params(Map.of(
"paramsKey", "params"))
.build()))
.cacheTo(DockerCacheOption.builder()
.type("type")
// the properties below are optional
.params(Map.of(
"paramsKey", "params"))
.build())
.directory("directory")
.dockerBuildArgs(Map.of(
"dockerBuildArgsKey", "dockerBuildArgs"))
.dockerBuildContexts(Map.of(
"dockerBuildContextsKey", "dockerBuildContexts"))
.dockerBuildSecrets(Map.of(
"dockerBuildSecretsKey", "dockerBuildSecrets"))
.dockerBuildSsh("dockerBuildSsh")
.dockerBuildTarget("dockerBuildTarget")
.dockerFile("dockerFile")
.dockerOutputs(List.of("dockerOutputs"))
.executable(List.of("executable"))
.networkMode("networkMode")
.platform("platform")
.build();
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.Cloud_assembly_schema;
var dockerImageSource = new DockerImageSource {
CacheDisabled = false,
CacheFrom = new [] { new DockerCacheOption {
Type = "type",
// the properties below are optional
Params = new Dictionary<string, string> {
{ "paramsKey", "params" }
}
} },
CacheTo = new DockerCacheOption {
Type = "type",
// the properties below are optional
Params = new Dictionary<string, string> {
{ "paramsKey", "params" }
}
},
Directory = "directory",
DockerBuildArgs = new Dictionary<string, string> {
{ "dockerBuildArgsKey", "dockerBuildArgs" }
},
DockerBuildContexts = new Dictionary<string, string> {
{ "dockerBuildContextsKey", "dockerBuildContexts" }
},
DockerBuildSecrets = new Dictionary<string, string> {
{ "dockerBuildSecretsKey", "dockerBuildSecrets" }
},
DockerBuildSsh = "dockerBuildSsh",
DockerBuildTarget = "dockerBuildTarget",
DockerFile = "dockerFile",
DockerOutputs = new [] { "dockerOutputs" },
Executable = new [] { "executable" },
NetworkMode = "networkMode",
Platform = "platform"
};
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"
dockerImageSource := &DockerImageSource{
CacheDisabled: jsii.Boolean(false),
CacheFrom: []DockerCacheOption{
&DockerCacheOption{
Type: jsii.String("type"),
// the properties below are optional
Params: map[string]*string{
"paramsKey": jsii.String("params"),
},
},
},
CacheTo: &DockerCacheOption{
Type: jsii.String("type"),
// the properties below are optional
Params: map[string]*string{
"paramsKey": jsii.String("params"),
},
},
Directory: jsii.String("directory"),
DockerBuildArgs: map[string]*string{
"dockerBuildArgsKey": jsii.String("dockerBuildArgs"),
},
DockerBuildContexts: map[string]*string{
"dockerBuildContextsKey": jsii.String("dockerBuildContexts"),
},
DockerBuildSecrets: map[string]*string{
"dockerBuildSecretsKey": jsii.String("dockerBuildSecrets"),
},
DockerBuildSsh: jsii.String("dockerBuildSsh"),
DockerBuildTarget: jsii.String("dockerBuildTarget"),
DockerFile: jsii.String("dockerFile"),
DockerOutputs: []*string{
jsii.String("dockerOutputs"),
},
Executable: []*string{
jsii.String("executable"),
},
NetworkMode: jsii.String("networkMode"),
Platform: jsii.String("platform"),
}
Properties
cacheDisabledoptionalbooleancache_disabledoptionalboolcacheDisabledoptionalBooleanCacheDisabledoptionalboolCacheDisabledoptional*bool #Default: cache is used
cacheFromoptionalDockerCacheOption[]cache_fromoptionaltyping.List[DockerCacheOption]cacheFromoptionalList<DockerCacheOption>CacheFromoptionalDockerCacheOption[]CacheFromoptional*[]DockerCacheOption #Default: no cache from options are passed to the build command
cacheTooptionalDockerCacheOptioncache_tooptionalDockerCacheOptioncacheTooptionalDockerCacheOptionCacheTooptionalDockerCacheOptionCacheTooptionalDockerCacheOption #Default: no cache to options are passed to the build command
directoryoptionalstringdirectoryoptionalstrdirectoryoptionalStringDirectoryoptionalstringDirectoryoptional*string #Default: Exactly one of directory and executable is required
This path is relative to the asset manifest location.
dockerBuildArgsoptional{ [key: string]: string }docker_build_argsoptionaltyping.Mapping[str, str]dockerBuildArgsoptionalMap<String, String>DockerBuildArgsoptionalIDictionary<string, string>DockerBuildArgsoptional*map[string]*string #Default: No additional build arguments
Only allowed when directory is set.
dockerBuildContextsoptional{ [key: string]: string }docker_build_contextsoptionaltyping.Mapping[str, str]dockerBuildContextsoptionalMap<String, String>DockerBuildContextsoptionalIDictionary<string, string>DockerBuildContextsoptional*map[string]*string #Default: No additional build contexts
Only allowed when directory is set.
dockerBuildSecretsoptional{ [key: string]: string }docker_build_secretsoptionaltyping.Mapping[str, str]dockerBuildSecretsoptionalMap<String, String>DockerBuildSecretsoptionalIDictionary<string, string>DockerBuildSecretsoptional*map[string]*string #Default: No additional build secrets
Only allowed when directory is set.
dockerBuildSshoptionalstringdocker_build_sshoptionalstrdockerBuildSshoptionalStringDockerBuildSshoptionalstringDockerBuildSshoptional*string #Default: No ssh flag is set
Requires building with docker buildkit.
dockerBuildTargetoptionalstringdocker_build_targetoptionalstrdockerBuildTargetoptionalStringDockerBuildTargetoptionalstringDockerBuildTargetoptional*string #Default: The last stage in the Dockerfile
Only allowed when directory is set.
dockerFileoptionalstringdocker_fileoptionalstrdockerFileoptionalStringDockerFileoptionalstringDockerFileoptional*string = "Dockerfile" #Only allowed when directory is set.
dockerOutputsoptionalstring[]docker_outputsoptionaltyping.List[str]dockerOutputsoptionalList<String>DockerOutputsoptionalstring[]DockerOutputsoptional*[]*string #Default: no outputs are passed to the build command (default outputs are used)
executableoptionalstring[]executableoptionaltyping.List[str]executableoptionalList<String>Executableoptionalstring[]Executableoptional*[]*string #Default: Exactly one of directory and executable is required
networkModeoptionalstringnetwork_modeoptionalstrnetworkModeoptionalStringNetworkModeoptionalstringNetworkModeoptional*string #Default: no networking mode specified
Specify this property to build images on a specific networking mode.
platformoptionalstringplatformoptionalstrplatformoptionalStringPlatformoptionalstringPlatformoptional*string #Default: current machine platform
Specify this property to build images on a specific platform/architecture.