Class: AWSCDK::CloudAssemblySchema::DockerImageSource
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::CloudAssemblySchema::DockerImageSource
- Defined in:
- cloud_assembly_schema/docker_image_source.rb
Overview
Properties for how to produce a Docker image from a source.
Instance Attribute Summary collapse
-
#cache_disabled ⇒ Boolean?
readonly
Disable the cache and pass
--no-cacheto thedocker buildcommand. -
#cache_from ⇒ Array<AWSCDK::CloudAssemblySchema::DockerCacheOption>?
readonly
Cache from options to pass to the
docker buildcommand. -
#cache_to ⇒ AWSCDK::CloudAssemblySchema::DockerCacheOption?
readonly
Cache to options to pass to the
docker buildcommand. -
#directory ⇒ String?
readonly
The directory containing the Docker image build instructions.
-
#docker_build_args ⇒ Hash{String => String}?
readonly
Additional build arguments.
-
#docker_build_contexts ⇒ Hash{String => String}?
readonly
Additional build contexts.
-
#docker_build_secrets ⇒ Hash{String => String}?
readonly
Additional build secrets.
-
#docker_build_ssh ⇒ String?
readonly
SSH agent socket or keys.
-
#docker_build_target ⇒ String?
readonly
Target build stage in a Dockerfile with multiple build stages.
-
#docker_file ⇒ String?
readonly
The name of the file with build instructions.
-
#docker_outputs ⇒ Array<String>?
readonly
Outputs.
-
#executable ⇒ Array<String>?
readonly
A command-line executable that returns the name of a local Docker image on stdout after being run.
-
#network_mode ⇒ String?
readonly
Networking mode for the RUN commands during build.
-
#platform ⇒ String?
readonly
Platform to build for.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(cache_disabled: nil, cache_from: nil, cache_to: nil, directory: nil, docker_build_args: nil, docker_build_contexts: nil, docker_build_secrets: nil, docker_build_ssh: nil, docker_build_target: nil, docker_file: nil, docker_outputs: nil, executable: nil, network_mode: nil, platform: nil) ⇒ DockerImageSource
constructor
A new instance of DockerImageSource.
- #to_jsii ⇒ Object
Constructor Details
#initialize(cache_disabled: nil, cache_from: nil, cache_to: nil, directory: nil, docker_build_args: nil, docker_build_contexts: nil, docker_build_secrets: nil, docker_build_ssh: nil, docker_build_target: nil, docker_file: nil, docker_outputs: nil, executable: nil, network_mode: nil, platform: nil) ⇒ DockerImageSource
Returns a new instance of DockerImageSource.
21 22 23 24 25 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 |
# File 'cloud_assembly_schema/docker_image_source.rb', line 21 def initialize(cache_disabled: nil, cache_from: nil, cache_to: nil, directory: nil, docker_build_args: nil, docker_build_contexts: nil, docker_build_secrets: nil, docker_build_ssh: nil, docker_build_target: nil, docker_file: nil, docker_outputs: nil, executable: nil, network_mode: nil, platform: 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::CloudAssemblySchema::DockerCacheOption.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : cache_from Jsii::Type.check_type(@cache_from, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmNsb3VkX2Fzc2VtYmx5X3NjaGVtYS5Eb2NrZXJDYWNoZU9wdGlvbiJ9LCJraW5kIjoiYXJyYXkifX0=")), "cacheFrom") unless @cache_from.nil? @cache_to = cache_to.is_a?(Hash) ? ::AWSCDK::CloudAssemblySchema::DockerCacheOption.new(**cache_to.transform_keys(&:to_sym)) : cache_to Jsii::Type.check_type(@cache_to, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5jbG91ZF9hc3NlbWJseV9zY2hlbWEuRG9ja2VyQ2FjaGVPcHRpb24ifQ==")), "cacheTo") unless @cache_to.nil? @directory = directory Jsii::Type.check_type(@directory, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "directory") unless @directory.nil? @docker_build_args = docker_build_args Jsii::Type.check_type(@docker_build_args, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoibWFwIn19")), "dockerBuildArgs") unless @docker_build_args.nil? @docker_build_contexts = docker_build_contexts Jsii::Type.check_type(@docker_build_contexts, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoibWFwIn19")), "dockerBuildContexts") unless @docker_build_contexts.nil? @docker_build_secrets = docker_build_secrets Jsii::Type.check_type(@docker_build_secrets, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoibWFwIn19")), "dockerBuildSecrets") unless @docker_build_secrets.nil? @docker_build_ssh = docker_build_ssh Jsii::Type.check_type(@docker_build_ssh, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "dockerBuildSsh") unless @docker_build_ssh.nil? @docker_build_target = docker_build_target Jsii::Type.check_type(@docker_build_target, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "dockerBuildTarget") unless @docker_build_target.nil? @docker_file = docker_file Jsii::Type.check_type(@docker_file, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "dockerFile") unless @docker_file.nil? @docker_outputs = docker_outputs Jsii::Type.check_type(@docker_outputs, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "dockerOutputs") unless @docker_outputs.nil? @executable = executable Jsii::Type.check_type(@executable, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "executable") unless @executable.nil? @network_mode = network_mode Jsii::Type.check_type(@network_mode, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "networkMode") unless @network_mode.nil? @platform = platform Jsii::Type.check_type(@platform, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "platform") unless @platform.nil? end |
Instance Attribute Details
#cache_disabled ⇒ Boolean? (readonly)
Default: - cache is used
Disable the cache and pass --no-cache to the docker build command.
56 57 58 |
# File 'cloud_assembly_schema/docker_image_source.rb', line 56 def cache_disabled @cache_disabled end |
#cache_from ⇒ Array<AWSCDK::CloudAssemblySchema::DockerCacheOption>? (readonly)
Default: - no cache from options are passed to the build command
Cache from options to pass to the docker build command.
62 63 64 |
# File 'cloud_assembly_schema/docker_image_source.rb', line 62 def cache_from @cache_from end |
#cache_to ⇒ AWSCDK::CloudAssemblySchema::DockerCacheOption? (readonly)
Default: - no cache to options are passed to the build command
Cache to options to pass to the docker build command.
68 69 70 |
# File 'cloud_assembly_schema/docker_image_source.rb', line 68 def cache_to @cache_to end |
#directory ⇒ String? (readonly)
Default: - Exactly one of directory and executable is required
The directory containing the Docker image build instructions.
This path is relative to the asset manifest location.
75 76 77 |
# File 'cloud_assembly_schema/docker_image_source.rb', line 75 def directory @directory end |
#docker_build_args ⇒ Hash{String => String}? (readonly)
Default: - No additional build arguments
Additional build arguments.
Only allowed when directory is set.
82 83 84 |
# File 'cloud_assembly_schema/docker_image_source.rb', line 82 def docker_build_args @docker_build_args end |
#docker_build_contexts ⇒ Hash{String => String}? (readonly)
Default: - No additional build contexts
Additional build contexts.
Only allowed when directory is set.
89 90 91 |
# File 'cloud_assembly_schema/docker_image_source.rb', line 89 def docker_build_contexts @docker_build_contexts end |
#docker_build_secrets ⇒ Hash{String => String}? (readonly)
Default: - No additional build secrets
Additional build secrets.
Only allowed when directory is set.
96 97 98 |
# File 'cloud_assembly_schema/docker_image_source.rb', line 96 def docker_build_secrets @docker_build_secrets end |
#docker_build_ssh ⇒ String? (readonly)
Default: - No ssh flag is set
SSH agent socket or keys.
Requires building with docker buildkit.
103 104 105 |
# File 'cloud_assembly_schema/docker_image_source.rb', line 103 def docker_build_ssh @docker_build_ssh end |
#docker_build_target ⇒ String? (readonly)
Default: - The last stage in the Dockerfile
Target build stage in a Dockerfile with multiple build stages.
Only allowed when directory is set.
110 111 112 |
# File 'cloud_assembly_schema/docker_image_source.rb', line 110 def docker_build_target @docker_build_target end |
#docker_file ⇒ String? (readonly)
Default: "Dockerfile"
The name of the file with build instructions.
Only allowed when directory is set.
117 118 119 |
# File 'cloud_assembly_schema/docker_image_source.rb', line 117 def docker_file @docker_file end |
#docker_outputs ⇒ Array<String>? (readonly)
Default: - no outputs are passed to the build command (default outputs are used)
Outputs.
123 124 125 |
# File 'cloud_assembly_schema/docker_image_source.rb', line 123 def docker_outputs @docker_outputs end |
#executable ⇒ Array<String>? (readonly)
Default: - Exactly one of directory and executable is required
A command-line executable that returns the name of a local Docker image on stdout after being run.
128 129 130 |
# File 'cloud_assembly_schema/docker_image_source.rb', line 128 def executable @executable end |
#network_mode ⇒ String? (readonly)
Default: - no networking mode specified
Networking mode for the RUN commands during build. Requires Docker Engine API v1.25+.
Specify this property to build images on a specific networking mode.
135 136 137 |
# File 'cloud_assembly_schema/docker_image_source.rb', line 135 def network_mode @network_mode end |
#platform ⇒ String? (readonly)
Default: - current machine platform
Platform to build for. Requires Docker Buildx.
Specify this property to build images on a specific platform/architecture.
142 143 144 |
# File 'cloud_assembly_schema/docker_image_source.rb', line 142 def platform @platform end |
Class Method Details
.jsii_properties ⇒ Object
144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 |
# File 'cloud_assembly_schema/docker_image_source.rb', line 144 def self.jsii_properties { :cache_disabled => "cacheDisabled", :cache_from => "cacheFrom", :cache_to => "cacheTo", :directory => "directory", :docker_build_args => "dockerBuildArgs", :docker_build_contexts => "dockerBuildContexts", :docker_build_secrets => "dockerBuildSecrets", :docker_build_ssh => "dockerBuildSsh", :docker_build_target => "dockerBuildTarget", :docker_file => "dockerFile", :docker_outputs => "dockerOutputs", :executable => "executable", :network_mode => "networkMode", :platform => "platform", } end |
Instance Method Details
#to_jsii ⇒ Object
163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 |
# File 'cloud_assembly_schema/docker_image_source.rb', line 163 def to_jsii result = {} result.merge!({ "cacheDisabled" => @cache_disabled, "cacheFrom" => @cache_from, "cacheTo" => @cache_to, "directory" => @directory, "dockerBuildArgs" => @docker_build_args, "dockerBuildContexts" => @docker_build_contexts, "dockerBuildSecrets" => @docker_build_secrets, "dockerBuildSsh" => @docker_build_ssh, "dockerBuildTarget" => @docker_build_target, "dockerFile" => @docker_file, "dockerOutputs" => @docker_outputs, "executable" => @executable, "networkMode" => @network_mode, "platform" => @platform, }) result.compact end |