Class: AWSCDK::Lambda::DockerBuildAssetOptions
- Inherits:
-
DockerBuildOptions
- Object
- DockerBuildOptions
- AWSCDK::Lambda::DockerBuildAssetOptions
- Defined in:
- lambda/docker_build_asset_options.rb
Overview
Options when creating an asset from a Docker build.
Instance Attribute Summary collapse
-
#build_args ⇒ Hash{String => String}?
readonly
Build args.
-
#build_contexts ⇒ Hash{String => String}?
readonly
Build contexts to pass to the
docker buildcommand. -
#cache_disabled ⇒ Boolean?
readonly
Disable the cache and pass
--no-cacheto thedocker buildcommand. -
#cache_from ⇒ Array<AWSCDK::DockerCacheOption>?
readonly
Cache from options to pass to the
docker buildcommand. -
#cache_to ⇒ AWSCDK::DockerCacheOption?
readonly
Cache to options to pass to the
docker buildcommand. -
#file ⇒ String?
readonly
Name of the Dockerfile, must relative to the docker build path.
-
#image_path ⇒ String?
readonly
The path in the Docker image where the asset is located after the build operation.
-
#network ⇒ String?
readonly
Docker Networking options.
-
#output_path ⇒ String?
readonly
The path on the local filesystem where the asset will be copied using
docker cp. -
#platform ⇒ String?
readonly
Set platform if server is multi-platform capable.
-
#target_stage ⇒ String?
readonly
Set build target for multi-stage container builds.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(build_args: nil, build_contexts: nil, cache_disabled: nil, cache_from: nil, cache_to: nil, file: nil, network: nil, platform: nil, target_stage: nil, image_path: nil, output_path: nil) ⇒ DockerBuildAssetOptions
constructor
A new instance of DockerBuildAssetOptions.
- #to_jsii ⇒ Object
Constructor Details
#initialize(build_args: nil, build_contexts: nil, cache_disabled: nil, cache_from: nil, cache_to: nil, file: nil, network: nil, platform: nil, target_stage: nil, image_path: nil, output_path: nil) ⇒ DockerBuildAssetOptions
Returns a new instance of DockerBuildAssetOptions.
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lambda/docker_build_asset_options.rb', line 18 def initialize(build_args: nil, build_contexts: nil, cache_disabled: nil, cache_from: nil, cache_to: nil, file: nil, network: nil, platform: nil, target_stage: nil, image_path: nil, output_path: 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? @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::DockerCacheOption.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : cache_from Jsii::Type.check_type(@cache_from, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLkRvY2tlckNhY2hlT3B0aW9uIn0sImtpbmQiOiJhcnJheSJ9fQ==")), "cacheFrom") unless @cache_from.nil? @cache_to = cache_to.is_a?(Hash) ? ::AWSCDK::DockerCacheOption.new(**cache_to.transform_keys(&:to_sym)) : cache_to Jsii::Type.check_type(@cache_to, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5Eb2NrZXJDYWNoZU9wdGlvbiJ9")), "cacheTo") unless @cache_to.nil? @file = file Jsii::Type.check_type(@file, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "file") unless @file.nil? @network = network Jsii::Type.check_type(@network, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "network") unless @network.nil? @platform = platform Jsii::Type.check_type(@platform, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "platform") unless @platform.nil? @target_stage = target_stage Jsii::Type.check_type(@target_stage, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "targetStage") unless @target_stage.nil? @image_path = image_path Jsii::Type.check_type(@image_path, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "imagePath") unless @image_path.nil? @output_path = output_path Jsii::Type.check_type(@output_path, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "outputPath") unless @output_path.nil? end |
Instance Attribute Details
#build_args ⇒ Hash{String => String}? (readonly)
Default: - no build args
Build args.
47 48 49 |
# File 'lambda/docker_build_asset_options.rb', line 47 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).
57 58 59 |
# File 'lambda/docker_build_asset_options.rb', line 57 def build_contexts @build_contexts end |
#cache_disabled ⇒ Boolean? (readonly)
Default: - cache is used
Disable the cache and pass --no-cache to the docker build command.
62 63 64 |
# File 'lambda/docker_build_asset_options.rb', line 62 def cache_disabled @cache_disabled end |
#cache_from ⇒ Array<AWSCDK::DockerCacheOption>? (readonly)
Default: - no cache from args are passed
Cache from options to pass to the docker build command.
67 68 69 |
# File 'lambda/docker_build_asset_options.rb', line 67 def cache_from @cache_from end |
#cache_to ⇒ AWSCDK::DockerCacheOption? (readonly)
Default: - no cache to args are passed
Cache to options to pass to the docker build command.
72 73 74 |
# File 'lambda/docker_build_asset_options.rb', line 72 def cache_to @cache_to end |
#file ⇒ String? (readonly)
Default: Dockerfile
Name of the Dockerfile, must relative to the docker build path.
77 78 79 |
# File 'lambda/docker_build_asset_options.rb', line 77 def file @file end |
#image_path ⇒ String? (readonly)
Default: /asset
The path in the Docker image where the asset is located after the build operation.
101 102 103 |
# File 'lambda/docker_build_asset_options.rb', line 101 def image_path @image_path end |
#network ⇒ String? (readonly)
Default: - no networking options
Docker Networking options.
82 83 84 |
# File 'lambda/docker_build_asset_options.rb', line 82 def network @network end |
#output_path ⇒ String? (readonly)
Default: - a unique temporary directory in the system temp directory
The path on the local filesystem where the asset will be copied using docker cp.
106 107 108 |
# File 'lambda/docker_build_asset_options.rb', line 106 def output_path @output_path end |
#platform ⇒ String? (readonly)
Default: - no platform specified
Set platform if server is multi-platform capable. Requires Docker Engine API v1.38+.
Example value: linux/amd64
89 90 91 |
# File 'lambda/docker_build_asset_options.rb', line 89 def platform @platform end |
#target_stage ⇒ String? (readonly)
Default: - Build all stages defined in the Dockerfile
Set build target for multi-stage container builds. Any stage defined afterwards will be ignored.
Example value: build-env
96 97 98 |
# File 'lambda/docker_build_asset_options.rb', line 96 def target_stage @target_stage end |
Class Method Details
.jsii_properties ⇒ Object
108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 |
# File 'lambda/docker_build_asset_options.rb', line 108 def self.jsii_properties { :build_args => "buildArgs", :build_contexts => "buildContexts", :cache_disabled => "cacheDisabled", :cache_from => "cacheFrom", :cache_to => "cacheTo", :file => "file", :network => "network", :platform => "platform", :target_stage => "targetStage", :image_path => "imagePath", :output_path => "outputPath", } end |
Instance Method Details
#to_jsii ⇒ Object
124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 |
# File 'lambda/docker_build_asset_options.rb', line 124 def to_jsii result = {} result.merge!(super) result.merge!({ "buildArgs" => @build_args, "buildContexts" => @build_contexts, "cacheDisabled" => @cache_disabled, "cacheFrom" => @cache_from, "cacheTo" => @cache_to, "file" => @file, "network" => @network, "platform" => @platform, "targetStage" => @target_stage, "imagePath" => @image_path, "outputPath" => @output_path, }) result.compact end |