Class: AWSCDK::ECRAssets::DockerImageAssetProps
- Inherits:
-
DockerImageAssetOptions
- Object
- DockerImageAssetOptions
- AWSCDK::ECRAssets::DockerImageAssetProps
- Defined in:
- ecr_assets/docker_image_asset_props.rb
Overview
Props for DockerImageAssets.
Instance Attribute Summary collapse
-
#asset_name ⇒ String?
readonly
Unique identifier of the docker image asset and its potential revisions.
-
#build_args ⇒ Hash{String => String}?
readonly
Build args to pass to the
docker buildcommand. -
#build_contexts ⇒ Hash{String => String}?
readonly
Build contexts to pass to the
docker buildcommand. -
#build_secrets ⇒ Hash{String => String}?
readonly
Build secrets.
-
#build_ssh ⇒ String?
readonly
SSH agent socket or keys to pass to the
docker buildcommand. -
#cache_disabled ⇒ Boolean?
readonly
Disable the cache and pass
--no-cacheto thedocker buildcommand. -
#cache_from ⇒ Array<AWSCDK::ECRAssets::DockerCacheOption>?
readonly
Cache from options to pass to the
docker buildcommand. -
#cache_to ⇒ AWSCDK::ECRAssets::DockerCacheOption?
readonly
Cache to options to pass to the
docker buildcommand. -
#directory ⇒ String
readonly
The directory where the Dockerfile is stored.
-
#display_name ⇒ String?
readonly
A display name for this asset.
-
#exclude ⇒ Array<String>?
readonly
File paths matching the patterns will be excluded.
-
#extra_hash ⇒ String?
readonly
Extra information to encode into the fingerprint (e.g. build instructions and other inputs).
-
#file ⇒ String?
readonly
Path to the Dockerfile (relative to the directory).
-
#follow_symlinks ⇒ AWSCDK::SymlinkFollowMode?
readonly
A strategy for how to handle symlinks.
-
#ignore_mode ⇒ AWSCDK::IgnoreMode?
readonly
The ignore behavior to use for
excludepatterns. -
#invalidation ⇒ AWSCDK::ECRAssets::DockerImageAssetInvalidationOptions?
readonly
Options to control which parameters are used to invalidate the asset hash.
-
#network_mode ⇒ AWSCDK::ECRAssets::NetworkMode?
readonly
Networking mode for the RUN commands during build.
-
#outputs ⇒ Array<String>?
readonly
Outputs to pass to the
docker buildcommand. -
#platform ⇒ AWSCDK::ECRAssets::Platform?
readonly
Platform to build for.
-
#target ⇒ String?
readonly
Docker target to build to.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(exclude: nil, follow_symlinks: nil, ignore_mode: nil, extra_hash: nil, asset_name: nil, build_args: nil, build_contexts: nil, build_secrets: nil, build_ssh: nil, cache_disabled: nil, cache_from: nil, cache_to: nil, display_name: nil, file: nil, invalidation: nil, network_mode: nil, outputs: nil, platform: nil, target: nil, directory:) ⇒ DockerImageAssetProps
constructor
A new instance of DockerImageAssetProps.
- #to_jsii ⇒ Object
Constructor Details
#initialize(exclude: nil, follow_symlinks: nil, ignore_mode: nil, extra_hash: nil, asset_name: nil, build_args: nil, build_contexts: nil, build_secrets: nil, build_ssh: nil, cache_disabled: nil, cache_from: nil, cache_to: nil, display_name: nil, file: nil, invalidation: nil, network_mode: nil, outputs: nil, platform: nil, target: nil, directory:) ⇒ DockerImageAssetProps
Returns a new instance of DockerImageAssetProps.
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
# File 'ecr_assets/docker_image_asset_props.rb', line 27 def initialize(exclude: nil, follow_symlinks: nil, ignore_mode: nil, extra_hash: nil, asset_name: nil, build_args: nil, build_contexts: nil, build_secrets: nil, build_ssh: nil, cache_disabled: nil, cache_from: nil, cache_to: nil, display_name: nil, file: nil, invalidation: nil, network_mode: nil, outputs: nil, platform: nil, target: nil, directory:) @exclude = exclude Jsii::Type.check_type(@exclude, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "exclude") unless @exclude.nil? @follow_symlinks = follow_symlinks Jsii::Type.check_type(@follow_symlinks, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5TeW1saW5rRm9sbG93TW9kZSJ9")), "followSymlinks") unless @follow_symlinks.nil? @ignore_mode = ignore_mode Jsii::Type.check_type(@ignore_mode, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5JZ25vcmVNb2RlIn0=")), "ignoreMode") unless @ignore_mode.nil? @extra_hash = extra_hash Jsii::Type.check_type(@extra_hash, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "extraHash") unless @extra_hash.nil? @asset_name = asset_name Jsii::Type.check_type(@asset_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "assetName") unless @asset_name.nil? @build_args = build_args Jsii::Type.check_type(@build_args, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoibWFwIn19")), "buildArgs") unless @build_args.nil? @build_contexts = build_contexts Jsii::Type.check_type(@build_contexts, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoibWFwIn19")), "buildContexts") unless @build_contexts.nil? @build_secrets = build_secrets Jsii::Type.check_type(@build_secrets, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoibWFwIn19")), "buildSecrets") unless @build_secrets.nil? @build_ssh = build_ssh Jsii::Type.check_type(@build_ssh, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "buildSsh") unless @build_ssh.nil? @cache_disabled = cache_disabled Jsii::Type.check_type(@cache_disabled, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "cacheDisabled") unless @cache_disabled.nil? @cache_from = cache_from.is_a?(Array) ? cache_from.map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::ECRAssets::DockerCacheOption.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : cache_from Jsii::Type.check_type(@cache_from, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lY3JfYXNzZXRzLkRvY2tlckNhY2hlT3B0aW9uIn0sImtpbmQiOiJhcnJheSJ9fQ==")), "cacheFrom") unless @cache_from.nil? @cache_to = cache_to.is_a?(Hash) ? ::AWSCDK::ECRAssets::DockerCacheOption.new(**cache_to.transform_keys(&:to_sym)) : cache_to Jsii::Type.check_type(@cache_to, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNyX2Fzc2V0cy5Eb2NrZXJDYWNoZU9wdGlvbiJ9")), "cacheTo") unless @cache_to.nil? @display_name = display_name Jsii::Type.check_type(@display_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "displayName") unless @display_name.nil? @file = file Jsii::Type.check_type(@file, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "file") unless @file.nil? @invalidation = invalidation.is_a?(Hash) ? ::AWSCDK::ECRAssets::DockerImageAssetInvalidationOptions.new(**invalidation.transform_keys(&:to_sym)) : invalidation Jsii::Type.check_type(@invalidation, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNyX2Fzc2V0cy5Eb2NrZXJJbWFnZUFzc2V0SW52YWxpZGF0aW9uT3B0aW9ucyJ9")), "invalidation") unless @invalidation.nil? @network_mode = network_mode Jsii::Type.check_type(@network_mode, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNyX2Fzc2V0cy5OZXR3b3JrTW9kZSJ9")), "networkMode") unless @network_mode.nil? @outputs = outputs Jsii::Type.check_type(@outputs, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "outputs") unless @outputs.nil? @platform = platform Jsii::Type.check_type(@platform, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNyX2Fzc2V0cy5QbGF0Zm9ybSJ9")), "platform") unless @platform.nil? @target = target Jsii::Type.check_type(@target, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "target") unless @target.nil? @directory = directory Jsii::Type.check_type(@directory, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "directory") end |
Instance Attribute Details
#asset_name ⇒ String? (readonly)
Default: - no asset name
Unique identifier of the docker image asset and its potential revisions.
Required if using AppScopedStagingSynthesizer.
99 100 101 |
# File 'ecr_assets/docker_image_asset_props.rb', line 99 def asset_name @asset_name end |
#build_args ⇒ Hash{String => String}? (readonly)
Default: - no build args are passed
Build args to pass to the docker build command.
Since Docker build arguments are resolved before deployment, keys and
values cannot refer to unresolved tokens (such as lambda.functionArn or
queue.queueUrl).
108 109 110 |
# File 'ecr_assets/docker_image_asset_props.rb', line 108 def build_args @build_args end |
#build_contexts ⇒ Hash{String => String}? (readonly)
Default: - no additional build contexts
Build contexts to pass to the docker build command.
Build contexts can be used to specify additional directories or images to use during the build. Each entry specifies a named build context and its source (a directory path, a URL, or a docker image).
Since Docker build contexts are resolved before deployment, keys and
values cannot refer to unresolved tokens (such as lambda.functionArn or
queue.queueUrl).
122 123 124 |
# File 'ecr_assets/docker_image_asset_props.rb', line 122 def build_contexts @build_contexts end |
#build_secrets ⇒ Hash{String => String}? (readonly)
Default: - no build secrets
Build secrets.
Docker BuildKit must be enabled to use build secrets.
136 137 138 |
# File 'ecr_assets/docker_image_asset_props.rb', line 136 def build_secrets @build_secrets end |
#build_ssh ⇒ String? (readonly)
Default: - no --ssh flag
SSH agent socket or keys to pass to the docker build command.
Docker BuildKit must be enabled to use the ssh flag
144 145 146 |
# File 'ecr_assets/docker_image_asset_props.rb', line 144 def build_ssh @build_ssh end |
#cache_disabled ⇒ Boolean? (readonly)
Default: - cache is used
Disable the cache and pass --no-cache to the docker build command.
149 150 151 |
# File 'ecr_assets/docker_image_asset_props.rb', line 149 def cache_disabled @cache_disabled end |
#cache_from ⇒ Array<AWSCDK::ECRAssets::DockerCacheOption>? (readonly)
Default: - no cache from options are passed to the build command
Cache from options to pass to the docker build command.
155 156 157 |
# File 'ecr_assets/docker_image_asset_props.rb', line 155 def cache_from @cache_from end |
#cache_to ⇒ AWSCDK::ECRAssets::DockerCacheOption? (readonly)
Default: - no cache to options are passed to the build command
Cache to options to pass to the docker build command.
161 162 163 |
# File 'ecr_assets/docker_image_asset_props.rb', line 161 def cache_to @cache_to end |
#directory ⇒ String (readonly)
The directory where the Dockerfile is stored.
Any directory inside with a name that matches the CDK output folder (cdk.out by default) will be excluded from the asset
223 224 225 |
# File 'ecr_assets/docker_image_asset_props.rb', line 223 def directory @directory end |
#display_name ⇒ String? (readonly)
Default: - Stack-relative construct path
A display name for this asset.
If supplied, the display name will be used in locations where the asset identifier is printed, like in the CLI progress information. If the same asset is added multiple times, the display name of the first occurrence is used.
If asset_name is given, it will also be used as the default display_name.
Otherwise, the default is the construct path of the ImageAsset construct,
with respect to the enclosing stack. If the asset is produced by a
construct helper function (such as lambda.Code.fromAssetImage()), this
will look like MyFunction/AssetImage.
We use the stack-relative construct path so that in the common case where
you have multiple stacks with the same asset, we won't show something like
/MyBetaStack/MyFunction/Code when you are actually deploying to
production.
182 183 184 |
# File 'ecr_assets/docker_image_asset_props.rb', line 182 def display_name @display_name end |
#exclude ⇒ Array<String>? (readonly)
Default: - nothing is excluded
File paths matching the patterns will be excluded.
See ignore_mode to set the matching behavior.
Has no effect on Assets bundled using the bundling property.
77 78 79 |
# File 'ecr_assets/docker_image_asset_props.rb', line 77 def exclude @exclude end |
#extra_hash ⇒ String? (readonly)
Default: - hash is only based on source content
Extra information to encode into the fingerprint (e.g. build instructions and other inputs).
92 93 94 |
# File 'ecr_assets/docker_image_asset_props.rb', line 92 def extra_hash @extra_hash end |
#file ⇒ String? (readonly)
Default: 'Dockerfile'
Path to the Dockerfile (relative to the directory).
187 188 189 |
# File 'ecr_assets/docker_image_asset_props.rb', line 187 def file @file end |
#follow_symlinks ⇒ AWSCDK::SymlinkFollowMode? (readonly)
Default: SymlinkFollowMode.NEVER
A strategy for how to handle symlinks.
82 83 84 |
# File 'ecr_assets/docker_image_asset_props.rb', line 82 def follow_symlinks @follow_symlinks end |
#ignore_mode ⇒ AWSCDK::IgnoreMode? (readonly)
Default: IgnoreMode.GLOB
The ignore behavior to use for exclude patterns.
87 88 89 |
# File 'ecr_assets/docker_image_asset_props.rb', line 87 def ignore_mode @ignore_mode end |
#invalidation ⇒ AWSCDK::ECRAssets::DockerImageAssetInvalidationOptions? (readonly)
Default: - hash all parameters
Options to control which parameters are used to invalidate the asset hash.
192 193 194 |
# File 'ecr_assets/docker_image_asset_props.rb', line 192 def invalidation @invalidation end |
#network_mode ⇒ AWSCDK::ECRAssets::NetworkMode? (readonly)
Default: - no networking mode specified (the default networking mode NetworkMode.DEFAULT will be used)
Networking mode for the RUN commands during build.
Support docker API 1.25+.
199 200 201 |
# File 'ecr_assets/docker_image_asset_props.rb', line 199 def network_mode @network_mode end |
#outputs ⇒ Array<String>? (readonly)
Default: - no outputs are passed to the build command (default outputs are used)
Outputs to pass to the docker build command.
205 206 207 |
# File 'ecr_assets/docker_image_asset_props.rb', line 205 def outputs @outputs end |
#platform ⇒ AWSCDK::ECRAssets::Platform? (readonly)
Default: - no platform specified (the current machine architecture will be used)
Platform to build for.
Requires Docker Buildx.
212 213 214 |
# File 'ecr_assets/docker_image_asset_props.rb', line 212 def platform @platform end |
#target ⇒ String? (readonly)
Default: - no target
Docker target to build to.
217 218 219 |
# File 'ecr_assets/docker_image_asset_props.rb', line 217 def target @target end |
Class Method Details
.jsii_properties ⇒ Object
225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 |
# File 'ecr_assets/docker_image_asset_props.rb', line 225 def self.jsii_properties { :exclude => "exclude", :follow_symlinks => "followSymlinks", :ignore_mode => "ignoreMode", :extra_hash => "extraHash", :asset_name => "assetName", :build_args => "buildArgs", :build_contexts => "buildContexts", :build_secrets => "buildSecrets", :build_ssh => "buildSsh", :cache_disabled => "cacheDisabled", :cache_from => "cacheFrom", :cache_to => "cacheTo", :display_name => "displayName", :file => "file", :invalidation => "invalidation", :network_mode => "networkMode", :outputs => "outputs", :platform => "platform", :target => "target", :directory => "directory", } end |
Instance Method Details
#to_jsii ⇒ Object
250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 |
# File 'ecr_assets/docker_image_asset_props.rb', line 250 def to_jsii result = {} result.merge!(super) result.merge!({ "exclude" => @exclude, "followSymlinks" => @follow_symlinks, "ignoreMode" => @ignore_mode, "extraHash" => @extra_hash, "assetName" => @asset_name, "buildArgs" => @build_args, "buildContexts" => @build_contexts, "buildSecrets" => @build_secrets, "buildSsh" => @build_ssh, "cacheDisabled" => @cache_disabled, "cacheFrom" => @cache_from, "cacheTo" => @cache_to, "displayName" => @display_name, "file" => @file, "invalidation" => @invalidation, "networkMode" => @network_mode, "outputs" => @outputs, "platform" => @platform, "target" => @target, "directory" => @directory, }) result.compact end |