Class: AWSCDK::DockerRunOptions
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::DockerRunOptions
- Defined in:
- docker_run_options.rb
Overview
Docker run options.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#command ⇒ Array<String>?
readonly
The command to run in the container.
-
#entrypoint ⇒ Array<String>?
readonly
The entrypoint to run in the container.
-
#environment ⇒ Hash{String => String}?
readonly
The environment variables to pass to the container.
-
#network ⇒ String?
readonly
Docker Networking options.
-
#platform ⇒ String?
readonly
Set platform if server is multi-platform capable.
-
#security_opt ⇒ String?
readonly
Security configuration when running the docker container.
-
#user ⇒ String?
readonly
The user to use when running the container.
-
#volumes ⇒ Array<AWSCDK::DockerVolume>?
readonly
Docker volumes to mount.
-
#volumes_from ⇒ Array<String>?
readonly
Where to mount the specified volumes from.
-
#working_directory ⇒ String?
readonly
Working directory inside the container.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(command: nil, entrypoint: nil, environment: nil, network: nil, platform: nil, security_opt: nil, user: nil, volumes: nil, volumes_from: nil, working_directory: nil) ⇒ DockerRunOptions
constructor
A new instance of DockerRunOptions.
- #to_jsii ⇒ Object
Constructor Details
#initialize(command: nil, entrypoint: nil, environment: nil, network: nil, platform: nil, security_opt: nil, user: nil, volumes: nil, volumes_from: nil, working_directory: nil) ⇒ DockerRunOptions
Returns a new instance of DockerRunOptions.
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'docker_run_options.rb', line 17 def initialize(command: nil, entrypoint: nil, environment: nil, network: nil, platform: nil, security_opt: nil, user: nil, volumes: nil, volumes_from: nil, working_directory: nil) @command = command Jsii::Type.check_type(@command, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "command") unless @command.nil? @entrypoint = entrypoint Jsii::Type.check_type(@entrypoint, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "entrypoint") unless @entrypoint.nil? @environment = environment Jsii::Type.check_type(@environment, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoibWFwIn19")), "environment") unless @environment.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? @security_opt = security_opt Jsii::Type.check_type(@security_opt, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "securityOpt") unless @security_opt.nil? @user = user Jsii::Type.check_type(@user, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "user") unless @user.nil? @volumes = volumes.is_a?(Array) ? volumes.map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::DockerVolume.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : volumes Jsii::Type.check_type(@volumes, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLkRvY2tlclZvbHVtZSJ9LCJraW5kIjoiYXJyYXkifX0=")), "volumes") unless @volumes.nil? @volumes_from = volumes_from Jsii::Type.check_type(@volumes_from, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "volumesFrom") unless @volumes_from.nil? @working_directory = working_directory Jsii::Type.check_type(@working_directory, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "workingDirectory") unless @working_directory.nil? end |
Instance Attribute Details
#command ⇒ Array<String>? (readonly)
Default: - run the command defined in the image
The command to run in the container.
44 45 46 |
# File 'docker_run_options.rb', line 44 def command @command end |
#entrypoint ⇒ Array<String>? (readonly)
Default: - run the entrypoint defined in the image
The entrypoint to run in the container.
49 50 51 |
# File 'docker_run_options.rb', line 49 def entrypoint @entrypoint end |
#environment ⇒ Hash{String => String}? (readonly)
Default: - no environment variables.
The environment variables to pass to the container.
54 55 56 |
# File 'docker_run_options.rb', line 54 def environment @environment end |
#network ⇒ String? (readonly)
Default: - no networking options
Docker Networking options.
59 60 61 |
# File 'docker_run_options.rb', line 59 def network @network 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
66 67 68 |
# File 'docker_run_options.rb', line 66 def platform @platform end |
#security_opt ⇒ String? (readonly)
Default: - no security options
Security configuration when running the docker container.
71 72 73 |
# File 'docker_run_options.rb', line 71 def security_opt @security_opt end |
#user ⇒ String? (readonly)
Default: - root or image default
The user to use when running the container.
76 77 78 |
# File 'docker_run_options.rb', line 76 def user @user end |
#volumes ⇒ Array<AWSCDK::DockerVolume>? (readonly)
Default: - no volumes are mounted
Docker volumes to mount.
81 82 83 |
# File 'docker_run_options.rb', line 81 def volumes @volumes end |
#volumes_from ⇒ Array<String>? (readonly)
Default: - no containers are specified to mount volumes from
Where to mount the specified volumes from.
87 88 89 |
# File 'docker_run_options.rb', line 87 def volumes_from @volumes_from end |
#working_directory ⇒ String? (readonly)
Default: - image default
Working directory inside the container.
92 93 94 |
# File 'docker_run_options.rb', line 92 def working_directory @working_directory end |
Class Method Details
.jsii_properties ⇒ Object
94 95 96 97 98 99 100 101 102 103 104 105 106 107 |
# File 'docker_run_options.rb', line 94 def self.jsii_properties { :command => "command", :entrypoint => "entrypoint", :environment => "environment", :network => "network", :platform => "platform", :security_opt => "securityOpt", :user => "user", :volumes => "volumes", :volumes_from => "volumesFrom", :working_directory => "workingDirectory", } end |
Instance Method Details
#to_jsii ⇒ Object
109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 |
# File 'docker_run_options.rb', line 109 def to_jsii result = {} result.merge!({ "command" => @command, "entrypoint" => @entrypoint, "environment" => @environment, "network" => @network, "platform" => @platform, "securityOpt" => @security_opt, "user" => @user, "volumes" => @volumes, "volumesFrom" => @volumes_from, "workingDirectory" => @working_directory, }) result.compact end |