Class: AWSCDK::ECRAssets::DockerImageAssetOptions
- Inherits:
-
FileFingerprintOptions
- Object
- FileFingerprintOptions
- AWSCDK::ECRAssets::DockerImageAssetOptions
- Defined in:
- ecr_assets/docker_image_asset_options.rb
Overview
Options for DockerImageAsset.
Direct Known Subclasses
DockerImageAssetProps, AWSCDK::ECS::AssetImageProps, Lambda::AssetImageCodeProps
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. -
#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) ⇒ DockerImageAssetOptions
constructor
A new instance of DockerImageAssetOptions.
- #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) ⇒ DockerImageAssetOptions
Returns a new instance of DockerImageAssetOptions.
26 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 |
# File 'ecr_assets/docker_image_asset_options.rb', line 26 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) @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? 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.
96 97 98 |
# File 'ecr_assets/docker_image_asset_options.rb', line 96 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).
105 106 107 |
# File 'ecr_assets/docker_image_asset_options.rb', line 105 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).
119 120 121 |
# File 'ecr_assets/docker_image_asset_options.rb', line 119 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.
134 135 136 |
# File 'ecr_assets/docker_image_asset_options.rb', line 134 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
142 143 144 |
# File 'ecr_assets/docker_image_asset_options.rb', line 142 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.
147 148 149 |
# File 'ecr_assets/docker_image_asset_options.rb', line 147 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.
153 154 155 |
# File 'ecr_assets/docker_image_asset_options.rb', line 153 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.
159 160 161 |
# File 'ecr_assets/docker_image_asset_options.rb', line 159 def cache_to @cache_to 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.
180 181 182 |
# File 'ecr_assets/docker_image_asset_options.rb', line 180 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.
74 75 76 |
# File 'ecr_assets/docker_image_asset_options.rb', line 74 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).
89 90 91 |
# File 'ecr_assets/docker_image_asset_options.rb', line 89 def extra_hash @extra_hash end |
#file ⇒ String? (readonly)
Default: 'Dockerfile'
Path to the Dockerfile (relative to the directory).
185 186 187 |
# File 'ecr_assets/docker_image_asset_options.rb', line 185 def file @file end |
#follow_symlinks ⇒ AWSCDK::SymlinkFollowMode? (readonly)
Default: SymlinkFollowMode.NEVER
A strategy for how to handle symlinks.
79 80 81 |
# File 'ecr_assets/docker_image_asset_options.rb', line 79 def follow_symlinks @follow_symlinks end |
#ignore_mode ⇒ AWSCDK::IgnoreMode? (readonly)
Default: IgnoreMode.GLOB
The ignore behavior to use for exclude patterns.
84 85 86 |
# File 'ecr_assets/docker_image_asset_options.rb', line 84 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.
190 191 192 |
# File 'ecr_assets/docker_image_asset_options.rb', line 190 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+.
197 198 199 |
# File 'ecr_assets/docker_image_asset_options.rb', line 197 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.
203 204 205 |
# File 'ecr_assets/docker_image_asset_options.rb', line 203 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.
210 211 212 |
# File 'ecr_assets/docker_image_asset_options.rb', line 210 def platform @platform end |
#target ⇒ String? (readonly)
Default: - no target
Docker target to build to.
215 216 217 |
# File 'ecr_assets/docker_image_asset_options.rb', line 215 def target @target end |
Class Method Details
.jsii_properties ⇒ Object
217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 |
# File 'ecr_assets/docker_image_asset_options.rb', line 217 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", } end |
Instance Method Details
#to_jsii ⇒ Object
241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 |
# File 'ecr_assets/docker_image_asset_options.rb', line 241 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, }) result.compact end |