docker-engine 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (248) hide show
  1. checksums.yaml +7 -0
  2. data/.ignore +2 -0
  3. data/CHANGELOG.md +17 -0
  4. data/README.md +230 -0
  5. data/SECURITY.md +27 -0
  6. data/lib/docker_engine/client.rb +77 -0
  7. data/lib/docker_engine/errors.rb +228 -0
  8. data/lib/docker_engine/file_part.rb +58 -0
  9. data/lib/docker_engine/internal/transport/base_client.rb +567 -0
  10. data/lib/docker_engine/internal/transport/pooled_net_requester.rb +210 -0
  11. data/lib/docker_engine/internal/type/array_of.rb +168 -0
  12. data/lib/docker_engine/internal/type/base_model.rb +529 -0
  13. data/lib/docker_engine/internal/type/base_page.rb +55 -0
  14. data/lib/docker_engine/internal/type/boolean.rb +77 -0
  15. data/lib/docker_engine/internal/type/converter.rb +327 -0
  16. data/lib/docker_engine/internal/type/enum.rb +131 -0
  17. data/lib/docker_engine/internal/type/file_input.rb +111 -0
  18. data/lib/docker_engine/internal/type/hash_of.rb +188 -0
  19. data/lib/docker_engine/internal/type/request_parameters.rb +42 -0
  20. data/lib/docker_engine/internal/type/union.rb +243 -0
  21. data/lib/docker_engine/internal/type/unknown.rb +81 -0
  22. data/lib/docker_engine/internal/util.rb +920 -0
  23. data/lib/docker_engine/internal.rb +20 -0
  24. data/lib/docker_engine/models/auth_login_params.rb +32 -0
  25. data/lib/docker_engine/models/auth_response.rb +27 -0
  26. data/lib/docker_engine/models/config.rb +307 -0
  27. data/lib/docker_engine/models/container.rb +2489 -0
  28. data/lib/docker_engine/models/container_create_params.rb +1716 -0
  29. data/lib/docker_engine/models/container_delete_params.rb +38 -0
  30. data/lib/docker_engine/models/container_inspect_params.rb +22 -0
  31. data/lib/docker_engine/models/container_kill_params.rb +25 -0
  32. data/lib/docker_engine/models/container_list_params.rb +70 -0
  33. data/lib/docker_engine/models/container_list_response.rb +8 -0
  34. data/lib/docker_engine/models/container_logs_params.rb +74 -0
  35. data/lib/docker_engine/models/container_start_params.rb +27 -0
  36. data/lib/docker_engine/models/container_stop_params.rb +33 -0
  37. data/lib/docker_engine/models/create_request.rb +348 -0
  38. data/lib/docker_engine/models/create_response.rb +27 -0
  39. data/lib/docker_engine/models/error.rb +18 -0
  40. data/lib/docker_engine/models/image.rb +1393 -0
  41. data/lib/docker_engine/models/image_delete_params.rb +43 -0
  42. data/lib/docker_engine/models/image_delete_response.rb +28 -0
  43. data/lib/docker_engine/models/image_inspect_params.rb +22 -0
  44. data/lib/docker_engine/models/image_list_params.rb +68 -0
  45. data/lib/docker_engine/models/image_list_response.rb +8 -0
  46. data/lib/docker_engine/models/image_pull_params.rb +115 -0
  47. data/lib/docker_engine/models/network.rb +253 -0
  48. data/lib/docker_engine/models/network_create_params.rb +210 -0
  49. data/lib/docker_engine/models/network_create_response.rb +27 -0
  50. data/lib/docker_engine/models/network_delete_params.rb +14 -0
  51. data/lib/docker_engine/models/network_inspect_params.rb +30 -0
  52. data/lib/docker_engine/models/network_inspect_response.rb +131 -0
  53. data/lib/docker_engine/models/network_list_params.rb +40 -0
  54. data/lib/docker_engine/models/network_list_response.rb +8 -0
  55. data/lib/docker_engine/models/service.rb +520 -0
  56. data/lib/docker_engine/models/service_create_params.rb +34 -0
  57. data/lib/docker_engine/models/service_create_response.rb +32 -0
  58. data/lib/docker_engine/models/service_delete_params.rb +14 -0
  59. data/lib/docker_engine/models/service_inspect_params.rb +22 -0
  60. data/lib/docker_engine/models/service_list_params.rb +41 -0
  61. data/lib/docker_engine/models/service_list_response.rb +8 -0
  62. data/lib/docker_engine/models/spec.rb +2302 -0
  63. data/lib/docker_engine/models/summary.rb +763 -0
  64. data/lib/docker_engine/models/system_info_params.rb +14 -0
  65. data/lib/docker_engine/models/system_info_response.rb +1879 -0
  66. data/lib/docker_engine/models/system_ping_params.rb +14 -0
  67. data/lib/docker_engine/models/system_ping_response.rb +7 -0
  68. data/lib/docker_engine/models/system_version_params.rb +14 -0
  69. data/lib/docker_engine/models/system_version_response.rb +164 -0
  70. data/lib/docker_engine/models/volume.rb +650 -0
  71. data/lib/docker_engine/models/volume_create_params.rb +14 -0
  72. data/lib/docker_engine/models/volume_delete_params.rb +22 -0
  73. data/lib/docker_engine/models/volume_inspect_params.rb +14 -0
  74. data/lib/docker_engine/models/volume_list_params.rb +34 -0
  75. data/lib/docker_engine/models/volume_list_response.rb +34 -0
  76. data/lib/docker_engine/models.rb +121 -0
  77. data/lib/docker_engine/request_options.rb +77 -0
  78. data/lib/docker_engine/resources/auth.rb +38 -0
  79. data/lib/docker_engine/resources/containers.rb +258 -0
  80. data/lib/docker_engine/resources/images.rb +156 -0
  81. data/lib/docker_engine/resources/networks.rb +139 -0
  82. data/lib/docker_engine/resources/services.rb +113 -0
  83. data/lib/docker_engine/resources/system.rb +70 -0
  84. data/lib/docker_engine/resources/volumes.rb +105 -0
  85. data/lib/docker_engine/version.rb +5 -0
  86. data/lib/docker_engine.rb +114 -0
  87. data/manifest.yaml +17 -0
  88. data/rbi/docker_engine/client.rbi +56 -0
  89. data/rbi/docker_engine/errors.rbi +205 -0
  90. data/rbi/docker_engine/file_part.rbi +37 -0
  91. data/rbi/docker_engine/internal/transport/base_client.rbi +300 -0
  92. data/rbi/docker_engine/internal/transport/pooled_net_requester.rbi +84 -0
  93. data/rbi/docker_engine/internal/type/array_of.rbi +104 -0
  94. data/rbi/docker_engine/internal/type/base_model.rbi +314 -0
  95. data/rbi/docker_engine/internal/type/base_page.rbi +43 -0
  96. data/rbi/docker_engine/internal/type/boolean.rbi +58 -0
  97. data/rbi/docker_engine/internal/type/converter.rbi +222 -0
  98. data/rbi/docker_engine/internal/type/enum.rbi +82 -0
  99. data/rbi/docker_engine/internal/type/file_input.rbi +59 -0
  100. data/rbi/docker_engine/internal/type/hash_of.rbi +104 -0
  101. data/rbi/docker_engine/internal/type/request_parameters.rbi +31 -0
  102. data/rbi/docker_engine/internal/type/union.rbi +128 -0
  103. data/rbi/docker_engine/internal/type/unknown.rbi +58 -0
  104. data/rbi/docker_engine/internal/util.rbi +487 -0
  105. data/rbi/docker_engine/internal.rbi +18 -0
  106. data/rbi/docker_engine/models/auth_login_params.rbi +62 -0
  107. data/rbi/docker_engine/models/auth_response.rbi +39 -0
  108. data/rbi/docker_engine/models/config.rbi +442 -0
  109. data/rbi/docker_engine/models/container.rbi +4575 -0
  110. data/rbi/docker_engine/models/container_create_params.rbi +3297 -0
  111. data/rbi/docker_engine/models/container_delete_params.rbi +71 -0
  112. data/rbi/docker_engine/models/container_inspect_params.rbi +46 -0
  113. data/rbi/docker_engine/models/container_kill_params.rbi +46 -0
  114. data/rbi/docker_engine/models/container_list_params.rbi +124 -0
  115. data/rbi/docker_engine/models/container_list_response.rbi +11 -0
  116. data/rbi/docker_engine/models/container_logs_params.rbi +117 -0
  117. data/rbi/docker_engine/models/container_start_params.rbi +50 -0
  118. data/rbi/docker_engine/models/container_stop_params.rbi +60 -0
  119. data/rbi/docker_engine/models/create_request.rbi +702 -0
  120. data/rbi/docker_engine/models/create_response.rbi +36 -0
  121. data/rbi/docker_engine/models/error.rbi +28 -0
  122. data/rbi/docker_engine/models/image.rbi +2323 -0
  123. data/rbi/docker_engine/models/image_delete_params.rbi +75 -0
  124. data/rbi/docker_engine/models/image_delete_response.rbi +52 -0
  125. data/rbi/docker_engine/models/image_inspect_params.rbi +49 -0
  126. data/rbi/docker_engine/models/image_list_params.rbi +112 -0
  127. data/rbi/docker_engine/models/image_list_response.rbi +11 -0
  128. data/rbi/docker_engine/models/image_pull_params.rbi +186 -0
  129. data/rbi/docker_engine/models/network.rbi +419 -0
  130. data/rbi/docker_engine/models/network_create_params.rbi +362 -0
  131. data/rbi/docker_engine/models/network_create_response.rbi +37 -0
  132. data/rbi/docker_engine/models/network_delete_params.rbi +32 -0
  133. data/rbi/docker_engine/models/network_inspect_params.rbi +60 -0
  134. data/rbi/docker_engine/models/network_inspect_response.rbi +329 -0
  135. data/rbi/docker_engine/models/network_list_params.rbi +76 -0
  136. data/rbi/docker_engine/models/network_list_response.rbi +11 -0
  137. data/rbi/docker_engine/models/service.rbi +1076 -0
  138. data/rbi/docker_engine/models/service_create_params.rbi +77 -0
  139. data/rbi/docker_engine/models/service_create_response.rbi +50 -0
  140. data/rbi/docker_engine/models/service_delete_params.rbi +32 -0
  141. data/rbi/docker_engine/models/service_inspect_params.rbi +49 -0
  142. data/rbi/docker_engine/models/service_list_params.rbi +76 -0
  143. data/rbi/docker_engine/models/service_list_response.rbi +11 -0
  144. data/rbi/docker_engine/models/spec.rbi +4587 -0
  145. data/rbi/docker_engine/models/summary.rbi +1298 -0
  146. data/rbi/docker_engine/models/system_info_params.rbi +29 -0
  147. data/rbi/docker_engine/models/system_info_response.rbi +3587 -0
  148. data/rbi/docker_engine/models/system_ping_params.rbi +29 -0
  149. data/rbi/docker_engine/models/system_ping_response.rbi +7 -0
  150. data/rbi/docker_engine/models/system_version_params.rbi +32 -0
  151. data/rbi/docker_engine/models/system_version_response.rbi +282 -0
  152. data/rbi/docker_engine/models/volume.rbi +1218 -0
  153. data/rbi/docker_engine/models/volume_create_params.rbi +32 -0
  154. data/rbi/docker_engine/models/volume_delete_params.rbi +46 -0
  155. data/rbi/docker_engine/models/volume_inspect_params.rbi +32 -0
  156. data/rbi/docker_engine/models/volume_list_params.rbi +61 -0
  157. data/rbi/docker_engine/models/volume_list_response.rbi +55 -0
  158. data/rbi/docker_engine/models.rbi +83 -0
  159. data/rbi/docker_engine/request_options.rbi +59 -0
  160. data/rbi/docker_engine/resources/auth.rbi +30 -0
  161. data/rbi/docker_engine/resources/containers.rbi +231 -0
  162. data/rbi/docker_engine/resources/images.rbi +164 -0
  163. data/rbi/docker_engine/resources/networks.rbi +133 -0
  164. data/rbi/docker_engine/resources/services.rbi +88 -0
  165. data/rbi/docker_engine/resources/system.rbi +40 -0
  166. data/rbi/docker_engine/resources/volumes.rbi +80 -0
  167. data/rbi/docker_engine/version.rbi +5 -0
  168. data/sig/docker_engine/client.rbs +33 -0
  169. data/sig/docker_engine/errors.rbs +117 -0
  170. data/sig/docker_engine/file_part.rbs +21 -0
  171. data/sig/docker_engine/internal/transport/base_client.rbs +131 -0
  172. data/sig/docker_engine/internal/transport/pooled_net_requester.rbs +48 -0
  173. data/sig/docker_engine/internal/type/array_of.rbs +48 -0
  174. data/sig/docker_engine/internal/type/base_model.rbs +104 -0
  175. data/sig/docker_engine/internal/type/base_page.rbs +24 -0
  176. data/sig/docker_engine/internal/type/boolean.rbs +26 -0
  177. data/sig/docker_engine/internal/type/converter.rbs +79 -0
  178. data/sig/docker_engine/internal/type/enum.rbs +32 -0
  179. data/sig/docker_engine/internal/type/file_input.rbs +25 -0
  180. data/sig/docker_engine/internal/type/hash_of.rbs +48 -0
  181. data/sig/docker_engine/internal/type/request_parameters.rbs +19 -0
  182. data/sig/docker_engine/internal/type/union.rbs +52 -0
  183. data/sig/docker_engine/internal/type/unknown.rbs +26 -0
  184. data/sig/docker_engine/internal/util.rbs +185 -0
  185. data/sig/docker_engine/internal.rbs +9 -0
  186. data/sig/docker_engine/models/auth_login_params.rbs +38 -0
  187. data/sig/docker_engine/models/auth_response.rbs +17 -0
  188. data/sig/docker_engine/models/config.rbs +225 -0
  189. data/sig/docker_engine/models/container.rbs +1973 -0
  190. data/sig/docker_engine/models/container_create_params.rbs +1352 -0
  191. data/sig/docker_engine/models/container_delete_params.rbs +38 -0
  192. data/sig/docker_engine/models/container_inspect_params.rbs +25 -0
  193. data/sig/docker_engine/models/container_kill_params.rbs +25 -0
  194. data/sig/docker_engine/models/container_list_params.rbs +44 -0
  195. data/sig/docker_engine/models/container_list_response.rbs +7 -0
  196. data/sig/docker_engine/models/container_logs_params.rbs +70 -0
  197. data/sig/docker_engine/models/container_start_params.rbs +25 -0
  198. data/sig/docker_engine/models/container_stop_params.rbs +32 -0
  199. data/sig/docker_engine/models/create_request.rbs +255 -0
  200. data/sig/docker_engine/models/create_response.rbs +15 -0
  201. data/sig/docker_engine/models/error.rbs +13 -0
  202. data/sig/docker_engine/models/image.rbs +1038 -0
  203. data/sig/docker_engine/models/image_delete_params.rbs +38 -0
  204. data/sig/docker_engine/models/image_delete_response.rbs +24 -0
  205. data/sig/docker_engine/models/image_inspect_params.rbs +25 -0
  206. data/sig/docker_engine/models/image_list_params.rbs +56 -0
  207. data/sig/docker_engine/models/image_list_response.rbs +7 -0
  208. data/sig/docker_engine/models/image_pull_params.rbs +84 -0
  209. data/sig/docker_engine/models/network.rbs +236 -0
  210. data/sig/docker_engine/models/network_create_params.rbs +203 -0
  211. data/sig/docker_engine/models/network_create_response.rbs +15 -0
  212. data/sig/docker_engine/models/network_delete_params.rbs +15 -0
  213. data/sig/docker_engine/models/network_inspect_params.rbs +32 -0
  214. data/sig/docker_engine/models/network_inspect_response.rbs +149 -0
  215. data/sig/docker_engine/models/network_list_params.rbs +25 -0
  216. data/sig/docker_engine/models/network_list_response.rbs +7 -0
  217. data/sig/docker_engine/models/service.rbs +471 -0
  218. data/sig/docker_engine/models/service_create_params.rbs +38 -0
  219. data/sig/docker_engine/models/service_create_response.rbs +17 -0
  220. data/sig/docker_engine/models/service_delete_params.rbs +15 -0
  221. data/sig/docker_engine/models/service_inspect_params.rbs +26 -0
  222. data/sig/docker_engine/models/service_list_params.rbs +32 -0
  223. data/sig/docker_engine/models/service_list_response.rbs +7 -0
  224. data/sig/docker_engine/models/spec.rbs +1984 -0
  225. data/sig/docker_engine/models/summary.rbs +634 -0
  226. data/sig/docker_engine/models/system_info_params.rbs +15 -0
  227. data/sig/docker_engine/models/system_info_response.rbs +1380 -0
  228. data/sig/docker_engine/models/system_ping_params.rbs +15 -0
  229. data/sig/docker_engine/models/system_ping_response.rbs +5 -0
  230. data/sig/docker_engine/models/system_version_params.rbs +15 -0
  231. data/sig/docker_engine/models/system_version_response.rbs +127 -0
  232. data/sig/docker_engine/models/volume.rbs +478 -0
  233. data/sig/docker_engine/models/volume_create_params.rbs +15 -0
  234. data/sig/docker_engine/models/volume_delete_params.rbs +25 -0
  235. data/sig/docker_engine/models/volume_inspect_params.rbs +15 -0
  236. data/sig/docker_engine/models/volume_list_params.rbs +25 -0
  237. data/sig/docker_engine/models/volume_list_response.rbs +28 -0
  238. data/sig/docker_engine/models.rbs +81 -0
  239. data/sig/docker_engine/request_options.rbs +36 -0
  240. data/sig/docker_engine/resources/auth.rbs +14 -0
  241. data/sig/docker_engine/resources/containers.rbs +67 -0
  242. data/sig/docker_engine/resources/images.rbs +43 -0
  243. data/sig/docker_engine/resources/networks.rbs +41 -0
  244. data/sig/docker_engine/resources/services.rbs +30 -0
  245. data/sig/docker_engine/resources/system.rbs +17 -0
  246. data/sig/docker_engine/resources/volumes.rbs +28 -0
  247. data/sig/docker_engine/version.rbs +3 -0
  248. metadata +319 -0
@@ -0,0 +1,4575 @@
1
+ # typed: strong
2
+
3
+ module DockerEngine
4
+ module Models
5
+ class Container < DockerEngine::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(DockerEngine::Container, DockerEngine::Internal::AnyHash)
9
+ end
10
+
11
+ # The AppArmor profile set for the container.
12
+ sig { returns(T.nilable(String)) }
13
+ attr_reader :app_armor_profile
14
+
15
+ sig { params(app_armor_profile: String).void }
16
+ attr_writer :app_armor_profile
17
+
18
+ # The arguments to the command being run
19
+ sig { returns(T.nilable(T::Array[String])) }
20
+ attr_reader :args
21
+
22
+ sig { params(args: T::Array[String]).void }
23
+ attr_writer :args
24
+
25
+ # Configuration for a container that is portable between hosts.
26
+ sig { returns(T.nilable(DockerEngine::Config)) }
27
+ attr_reader :config
28
+
29
+ sig { params(config: DockerEngine::Config::OrHash).void }
30
+ attr_writer :config
31
+
32
+ # Date and time at which the container was created, formatted in
33
+ # [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds.
34
+ sig { returns(T.nilable(String)) }
35
+ attr_accessor :created
36
+
37
+ # The storage-driver used for the container's filesystem (graph-driver or
38
+ # snapshotter).
39
+ sig { returns(T.nilable(String)) }
40
+ attr_reader :driver
41
+
42
+ sig { params(driver: String).void }
43
+ attr_writer :driver
44
+
45
+ # IDs of exec instances that are running in the container.
46
+ sig { returns(T.nilable(T::Array[String])) }
47
+ attr_accessor :exec_ids
48
+
49
+ # Information about the storage driver used to store the container's and image's
50
+ # filesystem.
51
+ sig { returns(T.nilable(DockerEngine::Container::GraphDriver)) }
52
+ attr_reader :graph_driver
53
+
54
+ sig do
55
+ params(graph_driver: DockerEngine::Container::GraphDriver::OrHash).void
56
+ end
57
+ attr_writer :graph_driver
58
+
59
+ # Container configuration that depends on the host we are running on
60
+ sig { returns(T.nilable(DockerEngine::Container::HostConfig)) }
61
+ attr_reader :host_config
62
+
63
+ sig do
64
+ params(host_config: DockerEngine::Container::HostConfig::OrHash).void
65
+ end
66
+ attr_writer :host_config
67
+
68
+ # Location of the `/etc/hostname` generated for the container on the host.
69
+ #
70
+ # This file is managed through the docker daemon, and should not be accessed or
71
+ # modified by other tools.
72
+ sig { returns(T.nilable(String)) }
73
+ attr_reader :hostname_path
74
+
75
+ sig { params(hostname_path: String).void }
76
+ attr_writer :hostname_path
77
+
78
+ # Location of the `/etc/hosts` generated for the container on the host.
79
+ #
80
+ # This file is managed through the docker daemon, and should not be accessed or
81
+ # modified by other tools.
82
+ sig { returns(T.nilable(String)) }
83
+ attr_reader :hosts_path
84
+
85
+ sig { params(hosts_path: String).void }
86
+ attr_writer :hosts_path
87
+
88
+ # The ID of this container as a 128-bit (64-character) hexadecimal string (32
89
+ # bytes).
90
+ sig { returns(T.nilable(String)) }
91
+ attr_reader :id
92
+
93
+ sig { params(id: String).void }
94
+ attr_writer :id
95
+
96
+ # The ID (digest) of the image that this container was created from.
97
+ sig { returns(T.nilable(String)) }
98
+ attr_reader :image
99
+
100
+ sig { params(image: String).void }
101
+ attr_writer :image
102
+
103
+ # A descriptor struct containing digest, media type, and size, as defined in the
104
+ # [OCI Content Descriptors Specification](https://github.com/opencontainers/image-spec/blob/v1.0.1/descriptor.md).
105
+ sig do
106
+ returns(T.nilable(DockerEngine::Container::ImageManifestDescriptor))
107
+ end
108
+ attr_reader :image_manifest_descriptor
109
+
110
+ sig do
111
+ params(
112
+ image_manifest_descriptor:
113
+ DockerEngine::Container::ImageManifestDescriptor::OrHash
114
+ ).void
115
+ end
116
+ attr_writer :image_manifest_descriptor
117
+
118
+ # Location of the file used to buffer the container's logs. Depending on the
119
+ # logging-driver used for the container, this field may be omitted.
120
+ #
121
+ # This file is managed through the docker daemon, and should not be accessed or
122
+ # modified by other tools.
123
+ sig { returns(T.nilable(String)) }
124
+ attr_accessor :log_path
125
+
126
+ # SELinux mount label set for the container.
127
+ sig { returns(T.nilable(String)) }
128
+ attr_reader :mount_label
129
+
130
+ sig { params(mount_label: String).void }
131
+ attr_writer :mount_label
132
+
133
+ # List of mounts used by the container.
134
+ sig { returns(T.nilable(T::Array[DockerEngine::Container::Mount])) }
135
+ attr_reader :mounts
136
+
137
+ sig do
138
+ params(mounts: T::Array[DockerEngine::Container::Mount::OrHash]).void
139
+ end
140
+ attr_writer :mounts
141
+
142
+ # The name associated with this container.
143
+ #
144
+ # For historic reasons, the name may be prefixed with a forward-slash (`/`).
145
+ sig { returns(T.nilable(String)) }
146
+ attr_reader :name
147
+
148
+ sig { params(name: String).void }
149
+ attr_writer :name
150
+
151
+ # NetworkSettings exposes the network settings in the API
152
+ sig { returns(T.nilable(DockerEngine::Container::NetworkSettings)) }
153
+ attr_reader :network_settings
154
+
155
+ sig do
156
+ params(
157
+ network_settings: DockerEngine::Container::NetworkSettings::OrHash
158
+ ).void
159
+ end
160
+ attr_writer :network_settings
161
+
162
+ # The path to the command being run
163
+ sig { returns(T.nilable(String)) }
164
+ attr_reader :path
165
+
166
+ sig { params(path: String).void }
167
+ attr_writer :path
168
+
169
+ # The platform (operating system) for which the container was created.
170
+ #
171
+ # This field was introduced for the experimental "LCOW" (Linux Containers On
172
+ # Windows) features, which has been removed. In most cases, this field is equal to
173
+ # the host's operating system (`linux` or `windows`).
174
+ sig { returns(T.nilable(String)) }
175
+ attr_reader :platform
176
+
177
+ sig { params(platform: String).void }
178
+ attr_writer :platform
179
+
180
+ # SELinux process label set for the container.
181
+ sig { returns(T.nilable(String)) }
182
+ attr_reader :process_label
183
+
184
+ sig { params(process_label: String).void }
185
+ attr_writer :process_label
186
+
187
+ # Location of the `/etc/resolv.conf` generated for the container on the host.
188
+ #
189
+ # This file is managed through the docker daemon, and should not be accessed or
190
+ # modified by other tools.
191
+ sig { returns(T.nilable(String)) }
192
+ attr_reader :resolv_conf_path
193
+
194
+ sig { params(resolv_conf_path: String).void }
195
+ attr_writer :resolv_conf_path
196
+
197
+ # Number of times the container was restarted since it was created, or since
198
+ # daemon was started.
199
+ sig { returns(T.nilable(Integer)) }
200
+ attr_reader :restart_count
201
+
202
+ sig { params(restart_count: Integer).void }
203
+ attr_writer :restart_count
204
+
205
+ # The total size of all files in the read-only layers from the image that the
206
+ # container uses. These layers can be shared between containers.
207
+ #
208
+ # This field is omitted by default, and only set when size is requested in the API
209
+ # request.
210
+ sig { returns(T.nilable(Integer)) }
211
+ attr_accessor :size_root_fs
212
+
213
+ # The size of files that have been created or changed by this container.
214
+ #
215
+ # This field is omitted by default, and only set when size is requested in the API
216
+ # request.
217
+ sig { returns(T.nilable(Integer)) }
218
+ attr_accessor :size_rw
219
+
220
+ # ContainerState stores container's running state. It's part of ContainerJSONBase
221
+ # and will be returned by the "inspect" command.
222
+ sig { returns(T.nilable(DockerEngine::Container::State)) }
223
+ attr_reader :state
224
+
225
+ sig do
226
+ params(state: T.nilable(DockerEngine::Container::State::OrHash)).void
227
+ end
228
+ attr_writer :state
229
+
230
+ # Information about the storage used by the container.
231
+ sig { returns(T.nilable(DockerEngine::Container::Storage)) }
232
+ attr_reader :storage
233
+
234
+ sig { params(storage: DockerEngine::Container::Storage::OrHash).void }
235
+ attr_writer :storage
236
+
237
+ sig do
238
+ params(
239
+ app_armor_profile: String,
240
+ args: T::Array[String],
241
+ config: DockerEngine::Config::OrHash,
242
+ created: T.nilable(String),
243
+ driver: String,
244
+ exec_ids: T.nilable(T::Array[String]),
245
+ graph_driver: DockerEngine::Container::GraphDriver::OrHash,
246
+ host_config: DockerEngine::Container::HostConfig::OrHash,
247
+ hostname_path: String,
248
+ hosts_path: String,
249
+ id: String,
250
+ image: String,
251
+ image_manifest_descriptor:
252
+ DockerEngine::Container::ImageManifestDescriptor::OrHash,
253
+ log_path: T.nilable(String),
254
+ mount_label: String,
255
+ mounts: T::Array[DockerEngine::Container::Mount::OrHash],
256
+ name: String,
257
+ network_settings: DockerEngine::Container::NetworkSettings::OrHash,
258
+ path: String,
259
+ platform: String,
260
+ process_label: String,
261
+ resolv_conf_path: String,
262
+ restart_count: Integer,
263
+ size_root_fs: T.nilable(Integer),
264
+ size_rw: T.nilable(Integer),
265
+ state: T.nilable(DockerEngine::Container::State::OrHash),
266
+ storage: DockerEngine::Container::Storage::OrHash
267
+ ).returns(T.attached_class)
268
+ end
269
+ def self.new(
270
+ # The AppArmor profile set for the container.
271
+ app_armor_profile: nil,
272
+ # The arguments to the command being run
273
+ args: nil,
274
+ # Configuration for a container that is portable between hosts.
275
+ config: nil,
276
+ # Date and time at which the container was created, formatted in
277
+ # [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds.
278
+ created: nil,
279
+ # The storage-driver used for the container's filesystem (graph-driver or
280
+ # snapshotter).
281
+ driver: nil,
282
+ # IDs of exec instances that are running in the container.
283
+ exec_ids: nil,
284
+ # Information about the storage driver used to store the container's and image's
285
+ # filesystem.
286
+ graph_driver: nil,
287
+ # Container configuration that depends on the host we are running on
288
+ host_config: nil,
289
+ # Location of the `/etc/hostname` generated for the container on the host.
290
+ #
291
+ # This file is managed through the docker daemon, and should not be accessed or
292
+ # modified by other tools.
293
+ hostname_path: nil,
294
+ # Location of the `/etc/hosts` generated for the container on the host.
295
+ #
296
+ # This file is managed through the docker daemon, and should not be accessed or
297
+ # modified by other tools.
298
+ hosts_path: nil,
299
+ # The ID of this container as a 128-bit (64-character) hexadecimal string (32
300
+ # bytes).
301
+ id: nil,
302
+ # The ID (digest) of the image that this container was created from.
303
+ image: nil,
304
+ # A descriptor struct containing digest, media type, and size, as defined in the
305
+ # [OCI Content Descriptors Specification](https://github.com/opencontainers/image-spec/blob/v1.0.1/descriptor.md).
306
+ image_manifest_descriptor: nil,
307
+ # Location of the file used to buffer the container's logs. Depending on the
308
+ # logging-driver used for the container, this field may be omitted.
309
+ #
310
+ # This file is managed through the docker daemon, and should not be accessed or
311
+ # modified by other tools.
312
+ log_path: nil,
313
+ # SELinux mount label set for the container.
314
+ mount_label: nil,
315
+ # List of mounts used by the container.
316
+ mounts: nil,
317
+ # The name associated with this container.
318
+ #
319
+ # For historic reasons, the name may be prefixed with a forward-slash (`/`).
320
+ name: nil,
321
+ # NetworkSettings exposes the network settings in the API
322
+ network_settings: nil,
323
+ # The path to the command being run
324
+ path: nil,
325
+ # The platform (operating system) for which the container was created.
326
+ #
327
+ # This field was introduced for the experimental "LCOW" (Linux Containers On
328
+ # Windows) features, which has been removed. In most cases, this field is equal to
329
+ # the host's operating system (`linux` or `windows`).
330
+ platform: nil,
331
+ # SELinux process label set for the container.
332
+ process_label: nil,
333
+ # Location of the `/etc/resolv.conf` generated for the container on the host.
334
+ #
335
+ # This file is managed through the docker daemon, and should not be accessed or
336
+ # modified by other tools.
337
+ resolv_conf_path: nil,
338
+ # Number of times the container was restarted since it was created, or since
339
+ # daemon was started.
340
+ restart_count: nil,
341
+ # The total size of all files in the read-only layers from the image that the
342
+ # container uses. These layers can be shared between containers.
343
+ #
344
+ # This field is omitted by default, and only set when size is requested in the API
345
+ # request.
346
+ size_root_fs: nil,
347
+ # The size of files that have been created or changed by this container.
348
+ #
349
+ # This field is omitted by default, and only set when size is requested in the API
350
+ # request.
351
+ size_rw: nil,
352
+ # ContainerState stores container's running state. It's part of ContainerJSONBase
353
+ # and will be returned by the "inspect" command.
354
+ state: nil,
355
+ # Information about the storage used by the container.
356
+ storage: nil
357
+ )
358
+ end
359
+
360
+ sig do
361
+ override.returns(
362
+ {
363
+ app_armor_profile: String,
364
+ args: T::Array[String],
365
+ config: DockerEngine::Config,
366
+ created: T.nilable(String),
367
+ driver: String,
368
+ exec_ids: T.nilable(T::Array[String]),
369
+ graph_driver: DockerEngine::Container::GraphDriver,
370
+ host_config: DockerEngine::Container::HostConfig,
371
+ hostname_path: String,
372
+ hosts_path: String,
373
+ id: String,
374
+ image: String,
375
+ image_manifest_descriptor:
376
+ DockerEngine::Container::ImageManifestDescriptor,
377
+ log_path: T.nilable(String),
378
+ mount_label: String,
379
+ mounts: T::Array[DockerEngine::Container::Mount],
380
+ name: String,
381
+ network_settings: DockerEngine::Container::NetworkSettings,
382
+ path: String,
383
+ platform: String,
384
+ process_label: String,
385
+ resolv_conf_path: String,
386
+ restart_count: Integer,
387
+ size_root_fs: T.nilable(Integer),
388
+ size_rw: T.nilable(Integer),
389
+ state: T.nilable(DockerEngine::Container::State),
390
+ storage: DockerEngine::Container::Storage
391
+ }
392
+ )
393
+ end
394
+ def to_hash
395
+ end
396
+
397
+ class GraphDriver < DockerEngine::Internal::Type::BaseModel
398
+ OrHash =
399
+ T.type_alias do
400
+ T.any(
401
+ DockerEngine::Container::GraphDriver,
402
+ DockerEngine::Internal::AnyHash
403
+ )
404
+ end
405
+
406
+ # Low-level storage metadata, provided as key/value pairs.
407
+ #
408
+ # This information is driver-specific, and depends on the storage-driver in use,
409
+ # and should be used for informational purposes only.
410
+ sig { returns(T::Hash[Symbol, String]) }
411
+ attr_accessor :data
412
+
413
+ # Name of the storage driver.
414
+ sig { returns(String) }
415
+ attr_accessor :name
416
+
417
+ # Information about the storage driver used to store the container's and image's
418
+ # filesystem.
419
+ sig do
420
+ params(data: T::Hash[Symbol, String], name: String).returns(
421
+ T.attached_class
422
+ )
423
+ end
424
+ def self.new(
425
+ # Low-level storage metadata, provided as key/value pairs.
426
+ #
427
+ # This information is driver-specific, and depends on the storage-driver in use,
428
+ # and should be used for informational purposes only.
429
+ data:,
430
+ # Name of the storage driver.
431
+ name:
432
+ )
433
+ end
434
+
435
+ sig do
436
+ override.returns({ data: T::Hash[Symbol, String], name: String })
437
+ end
438
+ def to_hash
439
+ end
440
+ end
441
+
442
+ class HostConfig < DockerEngine::Internal::Type::BaseModel
443
+ OrHash =
444
+ T.type_alias do
445
+ T.any(
446
+ DockerEngine::Container::HostConfig,
447
+ DockerEngine::Internal::AnyHash
448
+ )
449
+ end
450
+
451
+ # Arbitrary non-identifying metadata attached to container and provided to the
452
+ # runtime when the container is started.
453
+ sig { returns(T.nilable(T::Hash[Symbol, String])) }
454
+ attr_reader :annotations
455
+
456
+ sig { params(annotations: T::Hash[Symbol, String]).void }
457
+ attr_writer :annotations
458
+
459
+ # Automatically remove the container when the container's process exits. This has
460
+ # no effect if `RestartPolicy` is set.
461
+ sig { returns(T.nilable(T::Boolean)) }
462
+ attr_reader :auto_remove
463
+
464
+ sig { params(auto_remove: T::Boolean).void }
465
+ attr_writer :auto_remove
466
+
467
+ # A list of volume bindings for this container. Each volume binding is a string in
468
+ # one of these forms:
469
+ #
470
+ # - `host-src:container-dest[:options]` to bind-mount a host path into the
471
+ # container. Both `host-src`, and `container-dest` must be an _absolute_ path.
472
+ # - `volume-name:container-dest[:options]` to bind-mount a volume managed by a
473
+ # volume driver into the container. `container-dest` must be an _absolute_ path.
474
+ #
475
+ # `options` is an optional, comma-delimited list of:
476
+ #
477
+ # - `nocopy` disables automatic copying of data from the container path to the
478
+ # volume. The `nocopy` flag only applies to named volumes.
479
+ # - `[ro|rw]` mounts a volume read-only or read-write, respectively. If omitted or
480
+ # set to `rw`, volumes are mounted read-write.
481
+ # - `[z|Z]` applies SELinux labels to allow or deny multiple containers to read
482
+ # and write to the same volume.
483
+ # - `z`: a _shared_ content label is applied to the content. This label
484
+ # indicates that multiple containers can share the volume content, for both
485
+ # reading and writing.
486
+ # - `Z`: a _private unshared_ label is applied to the content. This label
487
+ # indicates that only the current container can use a private volume. Labeling
488
+ # systems such as SELinux require proper labels to be placed on volume content
489
+ # that is mounted into a container. Without a label, the security system can
490
+ # prevent a container's processes from using the content. By default, the
491
+ # labels set by the host operating system are not modified.
492
+ # - `[[r]shared|[r]slave|[r]private]` specifies mount
493
+ # [propagation behavior](https://www.kernel.org/doc/Documentation/filesystems/sharedsubtree.txt).
494
+ # This only applies to bind-mounted volumes, not internal volumes or named
495
+ # volumes. Mount propagation requires the source mount point (the location where
496
+ # the source directory is mounted in the host operating system) to have the
497
+ # correct propagation properties. For shared volumes, the source mount point
498
+ # must be set to `shared`. For slave volumes, the mount must be set to either
499
+ # `shared` or `slave`.
500
+ sig { returns(T.nilable(T::Array[String])) }
501
+ attr_reader :binds
502
+
503
+ sig { params(binds: T::Array[String]).void }
504
+ attr_writer :binds
505
+
506
+ # Limit read rate (bytes per second) from a device, in the form:
507
+ #
508
+ # ```
509
+ # [{"Path": "device_path", "Rate": rate}]
510
+ # ```
511
+ sig do
512
+ returns(
513
+ T.nilable(
514
+ T::Array[DockerEngine::Container::HostConfig::BlkioDeviceReadBp]
515
+ )
516
+ )
517
+ end
518
+ attr_reader :blkio_device_read_bps
519
+
520
+ sig do
521
+ params(
522
+ blkio_device_read_bps:
523
+ T::Array[
524
+ DockerEngine::Container::HostConfig::BlkioDeviceReadBp::OrHash
525
+ ]
526
+ ).void
527
+ end
528
+ attr_writer :blkio_device_read_bps
529
+
530
+ # Limit read rate (IO per second) from a device, in the form:
531
+ #
532
+ # ```
533
+ # [{"Path": "device_path", "Rate": rate}]
534
+ # ```
535
+ sig do
536
+ returns(
537
+ T.nilable(
538
+ T::Array[DockerEngine::Container::HostConfig::BlkioDeviceReadIOp]
539
+ )
540
+ )
541
+ end
542
+ attr_reader :blkio_device_read_i_ops
543
+
544
+ sig do
545
+ params(
546
+ blkio_device_read_i_ops:
547
+ T::Array[
548
+ DockerEngine::Container::HostConfig::BlkioDeviceReadIOp::OrHash
549
+ ]
550
+ ).void
551
+ end
552
+ attr_writer :blkio_device_read_i_ops
553
+
554
+ # Limit write rate (bytes per second) to a device, in the form:
555
+ #
556
+ # ```
557
+ # [{"Path": "device_path", "Rate": rate}]
558
+ # ```
559
+ sig do
560
+ returns(
561
+ T.nilable(
562
+ T::Array[DockerEngine::Container::HostConfig::BlkioDeviceWriteBp]
563
+ )
564
+ )
565
+ end
566
+ attr_reader :blkio_device_write_bps
567
+
568
+ sig do
569
+ params(
570
+ blkio_device_write_bps:
571
+ T::Array[
572
+ DockerEngine::Container::HostConfig::BlkioDeviceWriteBp::OrHash
573
+ ]
574
+ ).void
575
+ end
576
+ attr_writer :blkio_device_write_bps
577
+
578
+ # Limit write rate (IO per second) to a device, in the form:
579
+ #
580
+ # ```
581
+ # [{"Path": "device_path", "Rate": rate}]
582
+ # ```
583
+ sig do
584
+ returns(
585
+ T.nilable(
586
+ T::Array[DockerEngine::Container::HostConfig::BlkioDeviceWriteIOp]
587
+ )
588
+ )
589
+ end
590
+ attr_reader :blkio_device_write_i_ops
591
+
592
+ sig do
593
+ params(
594
+ blkio_device_write_i_ops:
595
+ T::Array[
596
+ DockerEngine::Container::HostConfig::BlkioDeviceWriteIOp::OrHash
597
+ ]
598
+ ).void
599
+ end
600
+ attr_writer :blkio_device_write_i_ops
601
+
602
+ # Block IO weight (relative weight).
603
+ sig { returns(T.nilable(Integer)) }
604
+ attr_reader :blkio_weight
605
+
606
+ sig { params(blkio_weight: Integer).void }
607
+ attr_writer :blkio_weight
608
+
609
+ # Block IO weight (relative device weight) in the form:
610
+ #
611
+ # ```
612
+ # [{"Path": "device_path", "Weight": weight}]
613
+ # ```
614
+ sig do
615
+ returns(
616
+ T.nilable(
617
+ T::Array[DockerEngine::Container::HostConfig::BlkioWeightDevice]
618
+ )
619
+ )
620
+ end
621
+ attr_reader :blkio_weight_device
622
+
623
+ sig do
624
+ params(
625
+ blkio_weight_device:
626
+ T::Array[
627
+ DockerEngine::Container::HostConfig::BlkioWeightDevice::OrHash
628
+ ]
629
+ ).void
630
+ end
631
+ attr_writer :blkio_weight_device
632
+
633
+ # A list of kernel capabilities to add to the container. Conflicts with option
634
+ # 'Capabilities'.
635
+ sig { returns(T.nilable(T::Array[String])) }
636
+ attr_reader :cap_add
637
+
638
+ sig { params(cap_add: T::Array[String]).void }
639
+ attr_writer :cap_add
640
+
641
+ # A list of kernel capabilities to drop from the container. Conflicts with option
642
+ # 'Capabilities'.
643
+ sig { returns(T.nilable(T::Array[String])) }
644
+ attr_reader :cap_drop
645
+
646
+ sig { params(cap_drop: T::Array[String]).void }
647
+ attr_writer :cap_drop
648
+
649
+ # Cgroup to use for the container.
650
+ sig { returns(T.nilable(String)) }
651
+ attr_reader :cgroup
652
+
653
+ sig { params(cgroup: String).void }
654
+ attr_writer :cgroup
655
+
656
+ # cgroup namespace mode for the container. Possible values are:
657
+ #
658
+ # - `"private"`: the container runs in its own private cgroup namespace
659
+ # - `"host"`: use the host system's cgroup namespace
660
+ #
661
+ # If not specified, the daemon default is used, which can either be `"private"` or
662
+ # `"host"`, depending on daemon version, kernel support and configuration.
663
+ sig do
664
+ returns(
665
+ T.nilable(
666
+ DockerEngine::Container::HostConfig::CgroupnsMode::TaggedSymbol
667
+ )
668
+ )
669
+ end
670
+ attr_reader :cgroupns_mode
671
+
672
+ sig do
673
+ params(
674
+ cgroupns_mode:
675
+ DockerEngine::Container::HostConfig::CgroupnsMode::OrSymbol
676
+ ).void
677
+ end
678
+ attr_writer :cgroupns_mode
679
+
680
+ # Path to `cgroups` under which the container's `cgroup` is created. If the path
681
+ # is not absolute, the path is considered to be relative to the `cgroups` path of
682
+ # the init process. Cgroups are created if they do not already exist.
683
+ sig { returns(T.nilable(String)) }
684
+ attr_reader :cgroup_parent
685
+
686
+ sig { params(cgroup_parent: String).void }
687
+ attr_writer :cgroup_parent
688
+
689
+ # Initial console size, as an `[height, width]` array.
690
+ sig { returns(T.nilable(T::Array[Integer])) }
691
+ attr_accessor :console_size
692
+
693
+ # Path to a file where the container ID is written
694
+ sig { returns(T.nilable(String)) }
695
+ attr_reader :container_id_file
696
+
697
+ sig { params(container_id_file: String).void }
698
+ attr_writer :container_id_file
699
+
700
+ # The number of usable CPUs (Windows only).
701
+ #
702
+ # On Windows Server containers, the processor resource controls are mutually
703
+ # exclusive. The order of precedence is `CPUCount` first, then `CPUShares`, and
704
+ # `CPUPercent` last.
705
+ sig { returns(T.nilable(Integer)) }
706
+ attr_reader :cpu_count
707
+
708
+ sig { params(cpu_count: Integer).void }
709
+ attr_writer :cpu_count
710
+
711
+ # The usable percentage of the available CPUs (Windows only).
712
+ #
713
+ # On Windows Server containers, the processor resource controls are mutually
714
+ # exclusive. The order of precedence is `CPUCount` first, then `CPUShares`, and
715
+ # `CPUPercent` last.
716
+ sig { returns(T.nilable(Integer)) }
717
+ attr_reader :cpu_percent
718
+
719
+ sig { params(cpu_percent: Integer).void }
720
+ attr_writer :cpu_percent
721
+
722
+ # The length of a CPU period in microseconds.
723
+ sig { returns(T.nilable(Integer)) }
724
+ attr_reader :cpu_period
725
+
726
+ sig { params(cpu_period: Integer).void }
727
+ attr_writer :cpu_period
728
+
729
+ # Microseconds of CPU time that the container can get in a CPU period.
730
+ sig { returns(T.nilable(Integer)) }
731
+ attr_reader :cpu_quota
732
+
733
+ sig { params(cpu_quota: Integer).void }
734
+ attr_writer :cpu_quota
735
+
736
+ # The length of a CPU real-time period in microseconds. Set to 0 to allocate no
737
+ # time allocated to real-time tasks.
738
+ sig { returns(T.nilable(Integer)) }
739
+ attr_reader :cpu_realtime_period
740
+
741
+ sig { params(cpu_realtime_period: Integer).void }
742
+ attr_writer :cpu_realtime_period
743
+
744
+ # The length of a CPU real-time runtime in microseconds. Set to 0 to allocate no
745
+ # time allocated to real-time tasks.
746
+ sig { returns(T.nilable(Integer)) }
747
+ attr_reader :cpu_realtime_runtime
748
+
749
+ sig { params(cpu_realtime_runtime: Integer).void }
750
+ attr_writer :cpu_realtime_runtime
751
+
752
+ # CPUs in which to allow execution (e.g., `0-3`, `0,1`).
753
+ sig { returns(T.nilable(String)) }
754
+ attr_reader :cpuset_cpus
755
+
756
+ sig { params(cpuset_cpus: String).void }
757
+ attr_writer :cpuset_cpus
758
+
759
+ # Memory nodes (MEMs) in which to allow execution (0-3, 0,1). Only effective on
760
+ # NUMA systems.
761
+ sig { returns(T.nilable(String)) }
762
+ attr_reader :cpuset_mems
763
+
764
+ sig { params(cpuset_mems: String).void }
765
+ attr_writer :cpuset_mems
766
+
767
+ # An integer value representing this container's relative CPU weight versus other
768
+ # containers.
769
+ sig { returns(T.nilable(Integer)) }
770
+ attr_reader :cpu_shares
771
+
772
+ sig { params(cpu_shares: Integer).void }
773
+ attr_writer :cpu_shares
774
+
775
+ # a list of cgroup rules to apply to the container
776
+ sig { returns(T.nilable(T::Array[String])) }
777
+ attr_reader :device_cgroup_rules
778
+
779
+ sig { params(device_cgroup_rules: T::Array[String]).void }
780
+ attr_writer :device_cgroup_rules
781
+
782
+ # A list of requests for devices to be sent to device drivers.
783
+ sig do
784
+ returns(
785
+ T.nilable(
786
+ T::Array[DockerEngine::Container::HostConfig::DeviceRequest]
787
+ )
788
+ )
789
+ end
790
+ attr_reader :device_requests
791
+
792
+ sig do
793
+ params(
794
+ device_requests:
795
+ T::Array[
796
+ DockerEngine::Container::HostConfig::DeviceRequest::OrHash
797
+ ]
798
+ ).void
799
+ end
800
+ attr_writer :device_requests
801
+
802
+ # A list of devices to add to the container.
803
+ sig do
804
+ returns(
805
+ T.nilable(T::Array[DockerEngine::Container::HostConfig::Device])
806
+ )
807
+ end
808
+ attr_reader :devices
809
+
810
+ sig do
811
+ params(
812
+ devices:
813
+ T::Array[DockerEngine::Container::HostConfig::Device::OrHash]
814
+ ).void
815
+ end
816
+ attr_writer :devices
817
+
818
+ # A list of DNS servers for the container to use.
819
+ sig { returns(T.nilable(T::Array[String])) }
820
+ attr_reader :dns
821
+
822
+ sig { params(dns: T::Array[String]).void }
823
+ attr_writer :dns
824
+
825
+ # A list of DNS options.
826
+ sig { returns(T.nilable(T::Array[String])) }
827
+ attr_reader :dns_options
828
+
829
+ sig { params(dns_options: T::Array[String]).void }
830
+ attr_writer :dns_options
831
+
832
+ # A list of DNS search domains.
833
+ sig { returns(T.nilable(T::Array[String])) }
834
+ attr_reader :dns_search
835
+
836
+ sig { params(dns_search: T::Array[String]).void }
837
+ attr_writer :dns_search
838
+
839
+ # A list of hostnames/IP mappings to add to the container's `/etc/hosts` file.
840
+ # Specified in the form `["hostname:IP"]`.
841
+ sig { returns(T.nilable(T::Array[String])) }
842
+ attr_reader :extra_hosts
843
+
844
+ sig { params(extra_hosts: T::Array[String]).void }
845
+ attr_writer :extra_hosts
846
+
847
+ # A list of additional groups that the container process will run as.
848
+ sig { returns(T.nilable(T::Array[String])) }
849
+ attr_reader :group_add
850
+
851
+ sig { params(group_add: T::Array[String]).void }
852
+ attr_writer :group_add
853
+
854
+ # Run an init inside the container that forwards signals and reaps processes. This
855
+ # field is omitted if empty, and the default (as configured on the daemon) is
856
+ # used.
857
+ sig { returns(T.nilable(T::Boolean)) }
858
+ attr_accessor :init
859
+
860
+ # Maximum IO in bytes per second for the container system drive (Windows only).
861
+ sig { returns(T.nilable(Integer)) }
862
+ attr_reader :io_maximum_bandwidth
863
+
864
+ sig { params(io_maximum_bandwidth: Integer).void }
865
+ attr_writer :io_maximum_bandwidth
866
+
867
+ # Maximum IOps for the container system drive (Windows only)
868
+ sig { returns(T.nilable(Integer)) }
869
+ attr_reader :io_maximum_i_ops
870
+
871
+ sig { params(io_maximum_i_ops: Integer).void }
872
+ attr_writer :io_maximum_i_ops
873
+
874
+ # IPC sharing mode for the container. Possible values are:
875
+ #
876
+ # - `"none"`: own private IPC namespace, with /dev/shm not mounted
877
+ # - `"private"`: own private IPC namespace
878
+ # - `"shareable"`: own private IPC namespace, with a possibility to share it with
879
+ # other containers
880
+ # - `"container:<name|id>"`: join another (shareable) container's IPC namespace
881
+ # - `"host"`: use the host system's IPC namespace
882
+ #
883
+ # If not specified, daemon default is used, which can either be `"private"` or
884
+ # `"shareable"`, depending on daemon version and configuration.
885
+ sig { returns(T.nilable(String)) }
886
+ attr_reader :ipc_mode
887
+
888
+ sig { params(ipc_mode: String).void }
889
+ attr_writer :ipc_mode
890
+
891
+ # Isolation technology of the container. (Windows only)
892
+ sig do
893
+ returns(
894
+ T.nilable(
895
+ DockerEngine::Container::HostConfig::Isolation::TaggedSymbol
896
+ )
897
+ )
898
+ end
899
+ attr_reader :isolation
900
+
901
+ sig do
902
+ params(
903
+ isolation: DockerEngine::Container::HostConfig::Isolation::OrSymbol
904
+ ).void
905
+ end
906
+ attr_writer :isolation
907
+
908
+ # A list of links for the container in the form `container_name:alias`.
909
+ sig { returns(T.nilable(T::Array[String])) }
910
+ attr_reader :links
911
+
912
+ sig { params(links: T::Array[String]).void }
913
+ attr_writer :links
914
+
915
+ # The logging configuration for this container
916
+ sig do
917
+ returns(T.nilable(DockerEngine::Container::HostConfig::LogConfig))
918
+ end
919
+ attr_reader :log_config
920
+
921
+ sig do
922
+ params(
923
+ log_config: DockerEngine::Container::HostConfig::LogConfig::OrHash
924
+ ).void
925
+ end
926
+ attr_writer :log_config
927
+
928
+ # The list of paths to be masked inside the container (this overrides the default
929
+ # set of paths).
930
+ sig { returns(T.nilable(T::Array[String])) }
931
+ attr_reader :masked_paths
932
+
933
+ sig { params(masked_paths: T::Array[String]).void }
934
+ attr_writer :masked_paths
935
+
936
+ # Memory limit in bytes.
937
+ sig { returns(T.nilable(Integer)) }
938
+ attr_reader :memory
939
+
940
+ sig { params(memory: Integer).void }
941
+ attr_writer :memory
942
+
943
+ # Memory soft limit in bytes.
944
+ sig { returns(T.nilable(Integer)) }
945
+ attr_reader :memory_reservation
946
+
947
+ sig { params(memory_reservation: Integer).void }
948
+ attr_writer :memory_reservation
949
+
950
+ # Total memory limit (memory + swap). Set as `-1` to enable unlimited swap.
951
+ sig { returns(T.nilable(Integer)) }
952
+ attr_reader :memory_swap
953
+
954
+ sig { params(memory_swap: Integer).void }
955
+ attr_writer :memory_swap
956
+
957
+ # Tune a container's memory swappiness behavior. Accepts an integer between 0
958
+ # and 100.
959
+ sig { returns(T.nilable(Integer)) }
960
+ attr_reader :memory_swappiness
961
+
962
+ sig { params(memory_swappiness: Integer).void }
963
+ attr_writer :memory_swappiness
964
+
965
+ # Specification for mounts to be added to the container.
966
+ sig do
967
+ returns(
968
+ T.nilable(T::Array[DockerEngine::Container::HostConfig::Mount])
969
+ )
970
+ end
971
+ attr_reader :mounts
972
+
973
+ sig do
974
+ params(
975
+ mounts: T::Array[DockerEngine::Container::HostConfig::Mount::OrHash]
976
+ ).void
977
+ end
978
+ attr_writer :mounts
979
+
980
+ # CPU quota in units of 10<sup>-9</sup> CPUs.
981
+ sig { returns(T.nilable(Integer)) }
982
+ attr_reader :nano_cpus
983
+
984
+ sig { params(nano_cpus: Integer).void }
985
+ attr_writer :nano_cpus
986
+
987
+ # Network mode to use for this container. Supported standard values are: `bridge`,
988
+ # `host`, `none`, and `container:<name|id>`. Any other value is taken as a custom
989
+ # network's name to which this container should connect to.
990
+ sig { returns(T.nilable(String)) }
991
+ attr_reader :network_mode
992
+
993
+ sig { params(network_mode: String).void }
994
+ attr_writer :network_mode
995
+
996
+ # Disable OOM Killer for the container.
997
+ sig { returns(T.nilable(T::Boolean)) }
998
+ attr_reader :oom_kill_disable
999
+
1000
+ sig { params(oom_kill_disable: T::Boolean).void }
1001
+ attr_writer :oom_kill_disable
1002
+
1003
+ # An integer value containing the score given to the container in order to tune
1004
+ # OOM killer preferences.
1005
+ sig { returns(T.nilable(Integer)) }
1006
+ attr_reader :oom_score_adj
1007
+
1008
+ sig { params(oom_score_adj: Integer).void }
1009
+ attr_writer :oom_score_adj
1010
+
1011
+ # Set the PID (Process) Namespace mode for the container. It can be either:
1012
+ #
1013
+ # - `"container:<name|id>"`: joins another container's PID namespace
1014
+ # - `"host"`: use the host's PID namespace inside the container
1015
+ sig { returns(T.nilable(String)) }
1016
+ attr_reader :pid_mode
1017
+
1018
+ sig { params(pid_mode: String).void }
1019
+ attr_writer :pid_mode
1020
+
1021
+ # Tune a container's PIDs limit. Set `0` or `-1` for unlimited, or `null` to not
1022
+ # change.
1023
+ sig { returns(T.nilable(Integer)) }
1024
+ attr_accessor :pids_limit
1025
+
1026
+ # PortMap describes the mapping of container ports to host ports, using the
1027
+ # container's port-number and protocol as key in the format `<port>/<protocol>`,
1028
+ # for example, `80/udp`.
1029
+ #
1030
+ # If a container's port is mapped for multiple protocols, separate entries are
1031
+ # added to the mapping table.
1032
+ sig do
1033
+ returns(
1034
+ T.nilable(
1035
+ T::Hash[
1036
+ Symbol,
1037
+ T::Array[DockerEngine::Container::HostConfig::PortBinding]
1038
+ ]
1039
+ )
1040
+ )
1041
+ end
1042
+ attr_reader :port_bindings
1043
+
1044
+ sig do
1045
+ params(
1046
+ port_bindings:
1047
+ T::Hash[
1048
+ Symbol,
1049
+ T::Array[
1050
+ DockerEngine::Container::HostConfig::PortBinding::OrHash
1051
+ ]
1052
+ ]
1053
+ ).void
1054
+ end
1055
+ attr_writer :port_bindings
1056
+
1057
+ # Gives the container full access to the host.
1058
+ sig { returns(T.nilable(T::Boolean)) }
1059
+ attr_reader :privileged
1060
+
1061
+ sig { params(privileged: T::Boolean).void }
1062
+ attr_writer :privileged
1063
+
1064
+ # Allocates an ephemeral host port for all of a container's exposed ports.
1065
+ #
1066
+ # Ports are de-allocated when the container stops and allocated when the container
1067
+ # starts. The allocated port might be changed when restarting the container.
1068
+ #
1069
+ # The port is selected from the ephemeral port range that depends on the kernel.
1070
+ # For example, on Linux the range is defined by
1071
+ # `/proc/sys/net/ipv4/ip_local_port_range`.
1072
+ sig { returns(T.nilable(T::Boolean)) }
1073
+ attr_reader :publish_all_ports
1074
+
1075
+ sig { params(publish_all_ports: T::Boolean).void }
1076
+ attr_writer :publish_all_ports
1077
+
1078
+ # The list of paths to be set as read-only inside the container (this overrides
1079
+ # the default set of paths).
1080
+ sig { returns(T.nilable(T::Array[String])) }
1081
+ attr_reader :readonly_paths
1082
+
1083
+ sig { params(readonly_paths: T::Array[String]).void }
1084
+ attr_writer :readonly_paths
1085
+
1086
+ # Mount the container's root filesystem as read only.
1087
+ sig { returns(T.nilable(T::Boolean)) }
1088
+ attr_reader :readonly_rootfs
1089
+
1090
+ sig { params(readonly_rootfs: T::Boolean).void }
1091
+ attr_writer :readonly_rootfs
1092
+
1093
+ # The behavior to apply when the container exits. The default is not to restart.
1094
+ #
1095
+ # An ever increasing delay (double the previous delay, starting at 100ms) is added
1096
+ # before each restart to prevent flooding the server.
1097
+ sig do
1098
+ returns(T.nilable(DockerEngine::Container::HostConfig::RestartPolicy))
1099
+ end
1100
+ attr_reader :restart_policy
1101
+
1102
+ sig do
1103
+ params(
1104
+ restart_policy:
1105
+ DockerEngine::Container::HostConfig::RestartPolicy::OrHash
1106
+ ).void
1107
+ end
1108
+ attr_writer :restart_policy
1109
+
1110
+ # Runtime to use with this container.
1111
+ sig { returns(T.nilable(String)) }
1112
+ attr_accessor :runtime
1113
+
1114
+ # A list of string values to customize labels for MLS systems, such as SELinux.
1115
+ sig { returns(T.nilable(T::Array[String])) }
1116
+ attr_reader :security_opt
1117
+
1118
+ sig { params(security_opt: T::Array[String]).void }
1119
+ attr_writer :security_opt
1120
+
1121
+ # Size of `/dev/shm` in bytes. If omitted, the system uses 64MB.
1122
+ sig { returns(T.nilable(Integer)) }
1123
+ attr_reader :shm_size
1124
+
1125
+ sig { params(shm_size: Integer).void }
1126
+ attr_writer :shm_size
1127
+
1128
+ # Storage driver options for this container, in the form `{"size": "120G"}`.
1129
+ sig { returns(T.nilable(T::Hash[Symbol, String])) }
1130
+ attr_reader :storage_opt
1131
+
1132
+ sig { params(storage_opt: T::Hash[Symbol, String]).void }
1133
+ attr_writer :storage_opt
1134
+
1135
+ # A list of kernel parameters (sysctls) to set in the container.
1136
+ #
1137
+ # This field is omitted if not set.
1138
+ sig { returns(T.nilable(T::Hash[Symbol, String])) }
1139
+ attr_accessor :sysctls
1140
+
1141
+ # A map of container directories which should be replaced by tmpfs mounts, and
1142
+ # their corresponding mount options. For example:
1143
+ #
1144
+ # ```
1145
+ # { "/run": "rw,noexec,nosuid,size=65536k" }
1146
+ # ```
1147
+ sig { returns(T.nilable(T::Hash[Symbol, String])) }
1148
+ attr_reader :tmpfs
1149
+
1150
+ sig { params(tmpfs: T::Hash[Symbol, String]).void }
1151
+ attr_writer :tmpfs
1152
+
1153
+ # A list of resource limits to set in the container. For example:
1154
+ #
1155
+ # ```
1156
+ # {"Name": "nofile", "Soft": 1024, "Hard": 2048}
1157
+ # ```
1158
+ sig do
1159
+ returns(
1160
+ T.nilable(T::Array[DockerEngine::Container::HostConfig::Ulimit])
1161
+ )
1162
+ end
1163
+ attr_reader :ulimits
1164
+
1165
+ sig do
1166
+ params(
1167
+ ulimits:
1168
+ T::Array[DockerEngine::Container::HostConfig::Ulimit::OrHash]
1169
+ ).void
1170
+ end
1171
+ attr_writer :ulimits
1172
+
1173
+ # Sets the usernamespace mode for the container when usernamespace remapping
1174
+ # option is enabled.
1175
+ sig { returns(T.nilable(String)) }
1176
+ attr_reader :userns_mode
1177
+
1178
+ sig { params(userns_mode: String).void }
1179
+ attr_writer :userns_mode
1180
+
1181
+ # UTS namespace to use for the container.
1182
+ sig { returns(T.nilable(String)) }
1183
+ attr_reader :uts_mode
1184
+
1185
+ sig { params(uts_mode: String).void }
1186
+ attr_writer :uts_mode
1187
+
1188
+ # Driver that this container uses to mount volumes.
1189
+ sig { returns(T.nilable(String)) }
1190
+ attr_reader :volume_driver
1191
+
1192
+ sig { params(volume_driver: String).void }
1193
+ attr_writer :volume_driver
1194
+
1195
+ # A list of volumes to inherit from another container, specified in the form
1196
+ # `<container name>[:<ro|rw>]`.
1197
+ sig { returns(T.nilable(T::Array[String])) }
1198
+ attr_reader :volumes_from
1199
+
1200
+ sig { params(volumes_from: T::Array[String]).void }
1201
+ attr_writer :volumes_from
1202
+
1203
+ # Container configuration that depends on the host we are running on
1204
+ sig do
1205
+ params(
1206
+ annotations: T::Hash[Symbol, String],
1207
+ auto_remove: T::Boolean,
1208
+ binds: T::Array[String],
1209
+ blkio_device_read_bps:
1210
+ T::Array[
1211
+ DockerEngine::Container::HostConfig::BlkioDeviceReadBp::OrHash
1212
+ ],
1213
+ blkio_device_read_i_ops:
1214
+ T::Array[
1215
+ DockerEngine::Container::HostConfig::BlkioDeviceReadIOp::OrHash
1216
+ ],
1217
+ blkio_device_write_bps:
1218
+ T::Array[
1219
+ DockerEngine::Container::HostConfig::BlkioDeviceWriteBp::OrHash
1220
+ ],
1221
+ blkio_device_write_i_ops:
1222
+ T::Array[
1223
+ DockerEngine::Container::HostConfig::BlkioDeviceWriteIOp::OrHash
1224
+ ],
1225
+ blkio_weight: Integer,
1226
+ blkio_weight_device:
1227
+ T::Array[
1228
+ DockerEngine::Container::HostConfig::BlkioWeightDevice::OrHash
1229
+ ],
1230
+ cap_add: T::Array[String],
1231
+ cap_drop: T::Array[String],
1232
+ cgroup: String,
1233
+ cgroupns_mode:
1234
+ DockerEngine::Container::HostConfig::CgroupnsMode::OrSymbol,
1235
+ cgroup_parent: String,
1236
+ console_size: T.nilable(T::Array[Integer]),
1237
+ container_id_file: String,
1238
+ cpu_count: Integer,
1239
+ cpu_percent: Integer,
1240
+ cpu_period: Integer,
1241
+ cpu_quota: Integer,
1242
+ cpu_realtime_period: Integer,
1243
+ cpu_realtime_runtime: Integer,
1244
+ cpuset_cpus: String,
1245
+ cpuset_mems: String,
1246
+ cpu_shares: Integer,
1247
+ device_cgroup_rules: T::Array[String],
1248
+ device_requests:
1249
+ T::Array[
1250
+ DockerEngine::Container::HostConfig::DeviceRequest::OrHash
1251
+ ],
1252
+ devices:
1253
+ T::Array[DockerEngine::Container::HostConfig::Device::OrHash],
1254
+ dns: T::Array[String],
1255
+ dns_options: T::Array[String],
1256
+ dns_search: T::Array[String],
1257
+ extra_hosts: T::Array[String],
1258
+ group_add: T::Array[String],
1259
+ init: T.nilable(T::Boolean),
1260
+ io_maximum_bandwidth: Integer,
1261
+ io_maximum_i_ops: Integer,
1262
+ ipc_mode: String,
1263
+ isolation: DockerEngine::Container::HostConfig::Isolation::OrSymbol,
1264
+ links: T::Array[String],
1265
+ log_config: DockerEngine::Container::HostConfig::LogConfig::OrHash,
1266
+ masked_paths: T::Array[String],
1267
+ memory: Integer,
1268
+ memory_reservation: Integer,
1269
+ memory_swap: Integer,
1270
+ memory_swappiness: Integer,
1271
+ mounts:
1272
+ T::Array[DockerEngine::Container::HostConfig::Mount::OrHash],
1273
+ nano_cpus: Integer,
1274
+ network_mode: String,
1275
+ oom_kill_disable: T::Boolean,
1276
+ oom_score_adj: Integer,
1277
+ pid_mode: String,
1278
+ pids_limit: T.nilable(Integer),
1279
+ port_bindings:
1280
+ T::Hash[
1281
+ Symbol,
1282
+ T::Array[
1283
+ DockerEngine::Container::HostConfig::PortBinding::OrHash
1284
+ ]
1285
+ ],
1286
+ privileged: T::Boolean,
1287
+ publish_all_ports: T::Boolean,
1288
+ readonly_paths: T::Array[String],
1289
+ readonly_rootfs: T::Boolean,
1290
+ restart_policy:
1291
+ DockerEngine::Container::HostConfig::RestartPolicy::OrHash,
1292
+ runtime: T.nilable(String),
1293
+ security_opt: T::Array[String],
1294
+ shm_size: Integer,
1295
+ storage_opt: T::Hash[Symbol, String],
1296
+ sysctls: T.nilable(T::Hash[Symbol, String]),
1297
+ tmpfs: T::Hash[Symbol, String],
1298
+ ulimits:
1299
+ T::Array[DockerEngine::Container::HostConfig::Ulimit::OrHash],
1300
+ userns_mode: String,
1301
+ uts_mode: String,
1302
+ volume_driver: String,
1303
+ volumes_from: T::Array[String]
1304
+ ).returns(T.attached_class)
1305
+ end
1306
+ def self.new(
1307
+ # Arbitrary non-identifying metadata attached to container and provided to the
1308
+ # runtime when the container is started.
1309
+ annotations: nil,
1310
+ # Automatically remove the container when the container's process exits. This has
1311
+ # no effect if `RestartPolicy` is set.
1312
+ auto_remove: nil,
1313
+ # A list of volume bindings for this container. Each volume binding is a string in
1314
+ # one of these forms:
1315
+ #
1316
+ # - `host-src:container-dest[:options]` to bind-mount a host path into the
1317
+ # container. Both `host-src`, and `container-dest` must be an _absolute_ path.
1318
+ # - `volume-name:container-dest[:options]` to bind-mount a volume managed by a
1319
+ # volume driver into the container. `container-dest` must be an _absolute_ path.
1320
+ #
1321
+ # `options` is an optional, comma-delimited list of:
1322
+ #
1323
+ # - `nocopy` disables automatic copying of data from the container path to the
1324
+ # volume. The `nocopy` flag only applies to named volumes.
1325
+ # - `[ro|rw]` mounts a volume read-only or read-write, respectively. If omitted or
1326
+ # set to `rw`, volumes are mounted read-write.
1327
+ # - `[z|Z]` applies SELinux labels to allow or deny multiple containers to read
1328
+ # and write to the same volume.
1329
+ # - `z`: a _shared_ content label is applied to the content. This label
1330
+ # indicates that multiple containers can share the volume content, for both
1331
+ # reading and writing.
1332
+ # - `Z`: a _private unshared_ label is applied to the content. This label
1333
+ # indicates that only the current container can use a private volume. Labeling
1334
+ # systems such as SELinux require proper labels to be placed on volume content
1335
+ # that is mounted into a container. Without a label, the security system can
1336
+ # prevent a container's processes from using the content. By default, the
1337
+ # labels set by the host operating system are not modified.
1338
+ # - `[[r]shared|[r]slave|[r]private]` specifies mount
1339
+ # [propagation behavior](https://www.kernel.org/doc/Documentation/filesystems/sharedsubtree.txt).
1340
+ # This only applies to bind-mounted volumes, not internal volumes or named
1341
+ # volumes. Mount propagation requires the source mount point (the location where
1342
+ # the source directory is mounted in the host operating system) to have the
1343
+ # correct propagation properties. For shared volumes, the source mount point
1344
+ # must be set to `shared`. For slave volumes, the mount must be set to either
1345
+ # `shared` or `slave`.
1346
+ binds: nil,
1347
+ # Limit read rate (bytes per second) from a device, in the form:
1348
+ #
1349
+ # ```
1350
+ # [{"Path": "device_path", "Rate": rate}]
1351
+ # ```
1352
+ blkio_device_read_bps: nil,
1353
+ # Limit read rate (IO per second) from a device, in the form:
1354
+ #
1355
+ # ```
1356
+ # [{"Path": "device_path", "Rate": rate}]
1357
+ # ```
1358
+ blkio_device_read_i_ops: nil,
1359
+ # Limit write rate (bytes per second) to a device, in the form:
1360
+ #
1361
+ # ```
1362
+ # [{"Path": "device_path", "Rate": rate}]
1363
+ # ```
1364
+ blkio_device_write_bps: nil,
1365
+ # Limit write rate (IO per second) to a device, in the form:
1366
+ #
1367
+ # ```
1368
+ # [{"Path": "device_path", "Rate": rate}]
1369
+ # ```
1370
+ blkio_device_write_i_ops: nil,
1371
+ # Block IO weight (relative weight).
1372
+ blkio_weight: nil,
1373
+ # Block IO weight (relative device weight) in the form:
1374
+ #
1375
+ # ```
1376
+ # [{"Path": "device_path", "Weight": weight}]
1377
+ # ```
1378
+ blkio_weight_device: nil,
1379
+ # A list of kernel capabilities to add to the container. Conflicts with option
1380
+ # 'Capabilities'.
1381
+ cap_add: nil,
1382
+ # A list of kernel capabilities to drop from the container. Conflicts with option
1383
+ # 'Capabilities'.
1384
+ cap_drop: nil,
1385
+ # Cgroup to use for the container.
1386
+ cgroup: nil,
1387
+ # cgroup namespace mode for the container. Possible values are:
1388
+ #
1389
+ # - `"private"`: the container runs in its own private cgroup namespace
1390
+ # - `"host"`: use the host system's cgroup namespace
1391
+ #
1392
+ # If not specified, the daemon default is used, which can either be `"private"` or
1393
+ # `"host"`, depending on daemon version, kernel support and configuration.
1394
+ cgroupns_mode: nil,
1395
+ # Path to `cgroups` under which the container's `cgroup` is created. If the path
1396
+ # is not absolute, the path is considered to be relative to the `cgroups` path of
1397
+ # the init process. Cgroups are created if they do not already exist.
1398
+ cgroup_parent: nil,
1399
+ # Initial console size, as an `[height, width]` array.
1400
+ console_size: nil,
1401
+ # Path to a file where the container ID is written
1402
+ container_id_file: nil,
1403
+ # The number of usable CPUs (Windows only).
1404
+ #
1405
+ # On Windows Server containers, the processor resource controls are mutually
1406
+ # exclusive. The order of precedence is `CPUCount` first, then `CPUShares`, and
1407
+ # `CPUPercent` last.
1408
+ cpu_count: nil,
1409
+ # The usable percentage of the available CPUs (Windows only).
1410
+ #
1411
+ # On Windows Server containers, the processor resource controls are mutually
1412
+ # exclusive. The order of precedence is `CPUCount` first, then `CPUShares`, and
1413
+ # `CPUPercent` last.
1414
+ cpu_percent: nil,
1415
+ # The length of a CPU period in microseconds.
1416
+ cpu_period: nil,
1417
+ # Microseconds of CPU time that the container can get in a CPU period.
1418
+ cpu_quota: nil,
1419
+ # The length of a CPU real-time period in microseconds. Set to 0 to allocate no
1420
+ # time allocated to real-time tasks.
1421
+ cpu_realtime_period: nil,
1422
+ # The length of a CPU real-time runtime in microseconds. Set to 0 to allocate no
1423
+ # time allocated to real-time tasks.
1424
+ cpu_realtime_runtime: nil,
1425
+ # CPUs in which to allow execution (e.g., `0-3`, `0,1`).
1426
+ cpuset_cpus: nil,
1427
+ # Memory nodes (MEMs) in which to allow execution (0-3, 0,1). Only effective on
1428
+ # NUMA systems.
1429
+ cpuset_mems: nil,
1430
+ # An integer value representing this container's relative CPU weight versus other
1431
+ # containers.
1432
+ cpu_shares: nil,
1433
+ # a list of cgroup rules to apply to the container
1434
+ device_cgroup_rules: nil,
1435
+ # A list of requests for devices to be sent to device drivers.
1436
+ device_requests: nil,
1437
+ # A list of devices to add to the container.
1438
+ devices: nil,
1439
+ # A list of DNS servers for the container to use.
1440
+ dns: nil,
1441
+ # A list of DNS options.
1442
+ dns_options: nil,
1443
+ # A list of DNS search domains.
1444
+ dns_search: nil,
1445
+ # A list of hostnames/IP mappings to add to the container's `/etc/hosts` file.
1446
+ # Specified in the form `["hostname:IP"]`.
1447
+ extra_hosts: nil,
1448
+ # A list of additional groups that the container process will run as.
1449
+ group_add: nil,
1450
+ # Run an init inside the container that forwards signals and reaps processes. This
1451
+ # field is omitted if empty, and the default (as configured on the daemon) is
1452
+ # used.
1453
+ init: nil,
1454
+ # Maximum IO in bytes per second for the container system drive (Windows only).
1455
+ io_maximum_bandwidth: nil,
1456
+ # Maximum IOps for the container system drive (Windows only)
1457
+ io_maximum_i_ops: nil,
1458
+ # IPC sharing mode for the container. Possible values are:
1459
+ #
1460
+ # - `"none"`: own private IPC namespace, with /dev/shm not mounted
1461
+ # - `"private"`: own private IPC namespace
1462
+ # - `"shareable"`: own private IPC namespace, with a possibility to share it with
1463
+ # other containers
1464
+ # - `"container:<name|id>"`: join another (shareable) container's IPC namespace
1465
+ # - `"host"`: use the host system's IPC namespace
1466
+ #
1467
+ # If not specified, daemon default is used, which can either be `"private"` or
1468
+ # `"shareable"`, depending on daemon version and configuration.
1469
+ ipc_mode: nil,
1470
+ # Isolation technology of the container. (Windows only)
1471
+ isolation: nil,
1472
+ # A list of links for the container in the form `container_name:alias`.
1473
+ links: nil,
1474
+ # The logging configuration for this container
1475
+ log_config: nil,
1476
+ # The list of paths to be masked inside the container (this overrides the default
1477
+ # set of paths).
1478
+ masked_paths: nil,
1479
+ # Memory limit in bytes.
1480
+ memory: nil,
1481
+ # Memory soft limit in bytes.
1482
+ memory_reservation: nil,
1483
+ # Total memory limit (memory + swap). Set as `-1` to enable unlimited swap.
1484
+ memory_swap: nil,
1485
+ # Tune a container's memory swappiness behavior. Accepts an integer between 0
1486
+ # and 100.
1487
+ memory_swappiness: nil,
1488
+ # Specification for mounts to be added to the container.
1489
+ mounts: nil,
1490
+ # CPU quota in units of 10<sup>-9</sup> CPUs.
1491
+ nano_cpus: nil,
1492
+ # Network mode to use for this container. Supported standard values are: `bridge`,
1493
+ # `host`, `none`, and `container:<name|id>`. Any other value is taken as a custom
1494
+ # network's name to which this container should connect to.
1495
+ network_mode: nil,
1496
+ # Disable OOM Killer for the container.
1497
+ oom_kill_disable: nil,
1498
+ # An integer value containing the score given to the container in order to tune
1499
+ # OOM killer preferences.
1500
+ oom_score_adj: nil,
1501
+ # Set the PID (Process) Namespace mode for the container. It can be either:
1502
+ #
1503
+ # - `"container:<name|id>"`: joins another container's PID namespace
1504
+ # - `"host"`: use the host's PID namespace inside the container
1505
+ pid_mode: nil,
1506
+ # Tune a container's PIDs limit. Set `0` or `-1` for unlimited, or `null` to not
1507
+ # change.
1508
+ pids_limit: nil,
1509
+ # PortMap describes the mapping of container ports to host ports, using the
1510
+ # container's port-number and protocol as key in the format `<port>/<protocol>`,
1511
+ # for example, `80/udp`.
1512
+ #
1513
+ # If a container's port is mapped for multiple protocols, separate entries are
1514
+ # added to the mapping table.
1515
+ port_bindings: nil,
1516
+ # Gives the container full access to the host.
1517
+ privileged: nil,
1518
+ # Allocates an ephemeral host port for all of a container's exposed ports.
1519
+ #
1520
+ # Ports are de-allocated when the container stops and allocated when the container
1521
+ # starts. The allocated port might be changed when restarting the container.
1522
+ #
1523
+ # The port is selected from the ephemeral port range that depends on the kernel.
1524
+ # For example, on Linux the range is defined by
1525
+ # `/proc/sys/net/ipv4/ip_local_port_range`.
1526
+ publish_all_ports: nil,
1527
+ # The list of paths to be set as read-only inside the container (this overrides
1528
+ # the default set of paths).
1529
+ readonly_paths: nil,
1530
+ # Mount the container's root filesystem as read only.
1531
+ readonly_rootfs: nil,
1532
+ # The behavior to apply when the container exits. The default is not to restart.
1533
+ #
1534
+ # An ever increasing delay (double the previous delay, starting at 100ms) is added
1535
+ # before each restart to prevent flooding the server.
1536
+ restart_policy: nil,
1537
+ # Runtime to use with this container.
1538
+ runtime: nil,
1539
+ # A list of string values to customize labels for MLS systems, such as SELinux.
1540
+ security_opt: nil,
1541
+ # Size of `/dev/shm` in bytes. If omitted, the system uses 64MB.
1542
+ shm_size: nil,
1543
+ # Storage driver options for this container, in the form `{"size": "120G"}`.
1544
+ storage_opt: nil,
1545
+ # A list of kernel parameters (sysctls) to set in the container.
1546
+ #
1547
+ # This field is omitted if not set.
1548
+ sysctls: nil,
1549
+ # A map of container directories which should be replaced by tmpfs mounts, and
1550
+ # their corresponding mount options. For example:
1551
+ #
1552
+ # ```
1553
+ # { "/run": "rw,noexec,nosuid,size=65536k" }
1554
+ # ```
1555
+ tmpfs: nil,
1556
+ # A list of resource limits to set in the container. For example:
1557
+ #
1558
+ # ```
1559
+ # {"Name": "nofile", "Soft": 1024, "Hard": 2048}
1560
+ # ```
1561
+ ulimits: nil,
1562
+ # Sets the usernamespace mode for the container when usernamespace remapping
1563
+ # option is enabled.
1564
+ userns_mode: nil,
1565
+ # UTS namespace to use for the container.
1566
+ uts_mode: nil,
1567
+ # Driver that this container uses to mount volumes.
1568
+ volume_driver: nil,
1569
+ # A list of volumes to inherit from another container, specified in the form
1570
+ # `<container name>[:<ro|rw>]`.
1571
+ volumes_from: nil
1572
+ )
1573
+ end
1574
+
1575
+ sig do
1576
+ override.returns(
1577
+ {
1578
+ annotations: T::Hash[Symbol, String],
1579
+ auto_remove: T::Boolean,
1580
+ binds: T::Array[String],
1581
+ blkio_device_read_bps:
1582
+ T::Array[
1583
+ DockerEngine::Container::HostConfig::BlkioDeviceReadBp
1584
+ ],
1585
+ blkio_device_read_i_ops:
1586
+ T::Array[
1587
+ DockerEngine::Container::HostConfig::BlkioDeviceReadIOp
1588
+ ],
1589
+ blkio_device_write_bps:
1590
+ T::Array[
1591
+ DockerEngine::Container::HostConfig::BlkioDeviceWriteBp
1592
+ ],
1593
+ blkio_device_write_i_ops:
1594
+ T::Array[
1595
+ DockerEngine::Container::HostConfig::BlkioDeviceWriteIOp
1596
+ ],
1597
+ blkio_weight: Integer,
1598
+ blkio_weight_device:
1599
+ T::Array[
1600
+ DockerEngine::Container::HostConfig::BlkioWeightDevice
1601
+ ],
1602
+ cap_add: T::Array[String],
1603
+ cap_drop: T::Array[String],
1604
+ cgroup: String,
1605
+ cgroupns_mode:
1606
+ DockerEngine::Container::HostConfig::CgroupnsMode::TaggedSymbol,
1607
+ cgroup_parent: String,
1608
+ console_size: T.nilable(T::Array[Integer]),
1609
+ container_id_file: String,
1610
+ cpu_count: Integer,
1611
+ cpu_percent: Integer,
1612
+ cpu_period: Integer,
1613
+ cpu_quota: Integer,
1614
+ cpu_realtime_period: Integer,
1615
+ cpu_realtime_runtime: Integer,
1616
+ cpuset_cpus: String,
1617
+ cpuset_mems: String,
1618
+ cpu_shares: Integer,
1619
+ device_cgroup_rules: T::Array[String],
1620
+ device_requests:
1621
+ T::Array[DockerEngine::Container::HostConfig::DeviceRequest],
1622
+ devices: T::Array[DockerEngine::Container::HostConfig::Device],
1623
+ dns: T::Array[String],
1624
+ dns_options: T::Array[String],
1625
+ dns_search: T::Array[String],
1626
+ extra_hosts: T::Array[String],
1627
+ group_add: T::Array[String],
1628
+ init: T.nilable(T::Boolean),
1629
+ io_maximum_bandwidth: Integer,
1630
+ io_maximum_i_ops: Integer,
1631
+ ipc_mode: String,
1632
+ isolation:
1633
+ DockerEngine::Container::HostConfig::Isolation::TaggedSymbol,
1634
+ links: T::Array[String],
1635
+ log_config: DockerEngine::Container::HostConfig::LogConfig,
1636
+ masked_paths: T::Array[String],
1637
+ memory: Integer,
1638
+ memory_reservation: Integer,
1639
+ memory_swap: Integer,
1640
+ memory_swappiness: Integer,
1641
+ mounts: T::Array[DockerEngine::Container::HostConfig::Mount],
1642
+ nano_cpus: Integer,
1643
+ network_mode: String,
1644
+ oom_kill_disable: T::Boolean,
1645
+ oom_score_adj: Integer,
1646
+ pid_mode: String,
1647
+ pids_limit: T.nilable(Integer),
1648
+ port_bindings:
1649
+ T::Hash[
1650
+ Symbol,
1651
+ T::Array[DockerEngine::Container::HostConfig::PortBinding]
1652
+ ],
1653
+ privileged: T::Boolean,
1654
+ publish_all_ports: T::Boolean,
1655
+ readonly_paths: T::Array[String],
1656
+ readonly_rootfs: T::Boolean,
1657
+ restart_policy:
1658
+ DockerEngine::Container::HostConfig::RestartPolicy,
1659
+ runtime: T.nilable(String),
1660
+ security_opt: T::Array[String],
1661
+ shm_size: Integer,
1662
+ storage_opt: T::Hash[Symbol, String],
1663
+ sysctls: T.nilable(T::Hash[Symbol, String]),
1664
+ tmpfs: T::Hash[Symbol, String],
1665
+ ulimits: T::Array[DockerEngine::Container::HostConfig::Ulimit],
1666
+ userns_mode: String,
1667
+ uts_mode: String,
1668
+ volume_driver: String,
1669
+ volumes_from: T::Array[String]
1670
+ }
1671
+ )
1672
+ end
1673
+ def to_hash
1674
+ end
1675
+
1676
+ class BlkioDeviceReadBp < DockerEngine::Internal::Type::BaseModel
1677
+ OrHash =
1678
+ T.type_alias do
1679
+ T.any(
1680
+ DockerEngine::Container::HostConfig::BlkioDeviceReadBp,
1681
+ DockerEngine::Internal::AnyHash
1682
+ )
1683
+ end
1684
+
1685
+ # Device path
1686
+ sig { returns(T.nilable(String)) }
1687
+ attr_reader :path
1688
+
1689
+ sig { params(path: String).void }
1690
+ attr_writer :path
1691
+
1692
+ # Rate
1693
+ sig { returns(T.nilable(Integer)) }
1694
+ attr_reader :rate
1695
+
1696
+ sig { params(rate: Integer).void }
1697
+ attr_writer :rate
1698
+
1699
+ sig { params(path: String, rate: Integer).returns(T.attached_class) }
1700
+ def self.new(
1701
+ # Device path
1702
+ path: nil,
1703
+ # Rate
1704
+ rate: nil
1705
+ )
1706
+ end
1707
+
1708
+ sig { override.returns({ path: String, rate: Integer }) }
1709
+ def to_hash
1710
+ end
1711
+ end
1712
+
1713
+ class BlkioDeviceReadIOp < DockerEngine::Internal::Type::BaseModel
1714
+ OrHash =
1715
+ T.type_alias do
1716
+ T.any(
1717
+ DockerEngine::Container::HostConfig::BlkioDeviceReadIOp,
1718
+ DockerEngine::Internal::AnyHash
1719
+ )
1720
+ end
1721
+
1722
+ # Device path
1723
+ sig { returns(T.nilable(String)) }
1724
+ attr_reader :path
1725
+
1726
+ sig { params(path: String).void }
1727
+ attr_writer :path
1728
+
1729
+ # Rate
1730
+ sig { returns(T.nilable(Integer)) }
1731
+ attr_reader :rate
1732
+
1733
+ sig { params(rate: Integer).void }
1734
+ attr_writer :rate
1735
+
1736
+ sig { params(path: String, rate: Integer).returns(T.attached_class) }
1737
+ def self.new(
1738
+ # Device path
1739
+ path: nil,
1740
+ # Rate
1741
+ rate: nil
1742
+ )
1743
+ end
1744
+
1745
+ sig { override.returns({ path: String, rate: Integer }) }
1746
+ def to_hash
1747
+ end
1748
+ end
1749
+
1750
+ class BlkioDeviceWriteBp < DockerEngine::Internal::Type::BaseModel
1751
+ OrHash =
1752
+ T.type_alias do
1753
+ T.any(
1754
+ DockerEngine::Container::HostConfig::BlkioDeviceWriteBp,
1755
+ DockerEngine::Internal::AnyHash
1756
+ )
1757
+ end
1758
+
1759
+ # Device path
1760
+ sig { returns(T.nilable(String)) }
1761
+ attr_reader :path
1762
+
1763
+ sig { params(path: String).void }
1764
+ attr_writer :path
1765
+
1766
+ # Rate
1767
+ sig { returns(T.nilable(Integer)) }
1768
+ attr_reader :rate
1769
+
1770
+ sig { params(rate: Integer).void }
1771
+ attr_writer :rate
1772
+
1773
+ sig { params(path: String, rate: Integer).returns(T.attached_class) }
1774
+ def self.new(
1775
+ # Device path
1776
+ path: nil,
1777
+ # Rate
1778
+ rate: nil
1779
+ )
1780
+ end
1781
+
1782
+ sig { override.returns({ path: String, rate: Integer }) }
1783
+ def to_hash
1784
+ end
1785
+ end
1786
+
1787
+ class BlkioDeviceWriteIOp < DockerEngine::Internal::Type::BaseModel
1788
+ OrHash =
1789
+ T.type_alias do
1790
+ T.any(
1791
+ DockerEngine::Container::HostConfig::BlkioDeviceWriteIOp,
1792
+ DockerEngine::Internal::AnyHash
1793
+ )
1794
+ end
1795
+
1796
+ # Device path
1797
+ sig { returns(T.nilable(String)) }
1798
+ attr_reader :path
1799
+
1800
+ sig { params(path: String).void }
1801
+ attr_writer :path
1802
+
1803
+ # Rate
1804
+ sig { returns(T.nilable(Integer)) }
1805
+ attr_reader :rate
1806
+
1807
+ sig { params(rate: Integer).void }
1808
+ attr_writer :rate
1809
+
1810
+ sig { params(path: String, rate: Integer).returns(T.attached_class) }
1811
+ def self.new(
1812
+ # Device path
1813
+ path: nil,
1814
+ # Rate
1815
+ rate: nil
1816
+ )
1817
+ end
1818
+
1819
+ sig { override.returns({ path: String, rate: Integer }) }
1820
+ def to_hash
1821
+ end
1822
+ end
1823
+
1824
+ class BlkioWeightDevice < DockerEngine::Internal::Type::BaseModel
1825
+ OrHash =
1826
+ T.type_alias do
1827
+ T.any(
1828
+ DockerEngine::Container::HostConfig::BlkioWeightDevice,
1829
+ DockerEngine::Internal::AnyHash
1830
+ )
1831
+ end
1832
+
1833
+ sig { returns(T.nilable(String)) }
1834
+ attr_reader :path
1835
+
1836
+ sig { params(path: String).void }
1837
+ attr_writer :path
1838
+
1839
+ sig { returns(T.nilable(Integer)) }
1840
+ attr_reader :weight
1841
+
1842
+ sig { params(weight: Integer).void }
1843
+ attr_writer :weight
1844
+
1845
+ sig do
1846
+ params(path: String, weight: Integer).returns(T.attached_class)
1847
+ end
1848
+ def self.new(path: nil, weight: nil)
1849
+ end
1850
+
1851
+ sig { override.returns({ path: String, weight: Integer }) }
1852
+ def to_hash
1853
+ end
1854
+ end
1855
+
1856
+ # cgroup namespace mode for the container. Possible values are:
1857
+ #
1858
+ # - `"private"`: the container runs in its own private cgroup namespace
1859
+ # - `"host"`: use the host system's cgroup namespace
1860
+ #
1861
+ # If not specified, the daemon default is used, which can either be `"private"` or
1862
+ # `"host"`, depending on daemon version, kernel support and configuration.
1863
+ module CgroupnsMode
1864
+ extend DockerEngine::Internal::Type::Enum
1865
+
1866
+ TaggedSymbol =
1867
+ T.type_alias do
1868
+ T.all(Symbol, DockerEngine::Container::HostConfig::CgroupnsMode)
1869
+ end
1870
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
1871
+
1872
+ PRIVATE =
1873
+ T.let(
1874
+ :private,
1875
+ DockerEngine::Container::HostConfig::CgroupnsMode::TaggedSymbol
1876
+ )
1877
+ HOST =
1878
+ T.let(
1879
+ :host,
1880
+ DockerEngine::Container::HostConfig::CgroupnsMode::TaggedSymbol
1881
+ )
1882
+
1883
+ sig do
1884
+ override.returns(
1885
+ T::Array[
1886
+ DockerEngine::Container::HostConfig::CgroupnsMode::TaggedSymbol
1887
+ ]
1888
+ )
1889
+ end
1890
+ def self.values
1891
+ end
1892
+ end
1893
+
1894
+ class DeviceRequest < DockerEngine::Internal::Type::BaseModel
1895
+ OrHash =
1896
+ T.type_alias do
1897
+ T.any(
1898
+ DockerEngine::Container::HostConfig::DeviceRequest,
1899
+ DockerEngine::Internal::AnyHash
1900
+ )
1901
+ end
1902
+
1903
+ # A list of capabilities; an OR list of AND lists of capabilities.
1904
+ #
1905
+ # Note that if a driver is specified the capabilities have no effect on selecting
1906
+ # a driver as the driver name is used directly.
1907
+ #
1908
+ # Note that if no driver is specified the capabilities are used to select a driver
1909
+ # with the required capabilities.
1910
+ sig { returns(T.nilable(T::Array[T::Array[String]])) }
1911
+ attr_reader :capabilities
1912
+
1913
+ sig { params(capabilities: T::Array[T::Array[String]]).void }
1914
+ attr_writer :capabilities
1915
+
1916
+ sig { returns(T.nilable(Integer)) }
1917
+ attr_reader :count
1918
+
1919
+ sig { params(count: Integer).void }
1920
+ attr_writer :count
1921
+
1922
+ sig { returns(T.nilable(T::Array[String])) }
1923
+ attr_reader :device_ids
1924
+
1925
+ sig { params(device_ids: T::Array[String]).void }
1926
+ attr_writer :device_ids
1927
+
1928
+ # The name of the device driver to use for this request.
1929
+ #
1930
+ # Note that if this is specified the capabilities are ignored when selecting a
1931
+ # device driver.
1932
+ sig { returns(T.nilable(String)) }
1933
+ attr_reader :driver
1934
+
1935
+ sig { params(driver: String).void }
1936
+ attr_writer :driver
1937
+
1938
+ # Driver-specific options, specified as a key/value pairs. These options are
1939
+ # passed directly to the driver.
1940
+ sig { returns(T.nilable(T::Hash[Symbol, String])) }
1941
+ attr_reader :options
1942
+
1943
+ sig { params(options: T::Hash[Symbol, String]).void }
1944
+ attr_writer :options
1945
+
1946
+ # A request for devices to be sent to device drivers
1947
+ sig do
1948
+ params(
1949
+ capabilities: T::Array[T::Array[String]],
1950
+ count: Integer,
1951
+ device_ids: T::Array[String],
1952
+ driver: String,
1953
+ options: T::Hash[Symbol, String]
1954
+ ).returns(T.attached_class)
1955
+ end
1956
+ def self.new(
1957
+ # A list of capabilities; an OR list of AND lists of capabilities.
1958
+ #
1959
+ # Note that if a driver is specified the capabilities have no effect on selecting
1960
+ # a driver as the driver name is used directly.
1961
+ #
1962
+ # Note that if no driver is specified the capabilities are used to select a driver
1963
+ # with the required capabilities.
1964
+ capabilities: nil,
1965
+ count: nil,
1966
+ device_ids: nil,
1967
+ # The name of the device driver to use for this request.
1968
+ #
1969
+ # Note that if this is specified the capabilities are ignored when selecting a
1970
+ # device driver.
1971
+ driver: nil,
1972
+ # Driver-specific options, specified as a key/value pairs. These options are
1973
+ # passed directly to the driver.
1974
+ options: nil
1975
+ )
1976
+ end
1977
+
1978
+ sig do
1979
+ override.returns(
1980
+ {
1981
+ capabilities: T::Array[T::Array[String]],
1982
+ count: Integer,
1983
+ device_ids: T::Array[String],
1984
+ driver: String,
1985
+ options: T::Hash[Symbol, String]
1986
+ }
1987
+ )
1988
+ end
1989
+ def to_hash
1990
+ end
1991
+ end
1992
+
1993
+ class Device < DockerEngine::Internal::Type::BaseModel
1994
+ OrHash =
1995
+ T.type_alias do
1996
+ T.any(
1997
+ DockerEngine::Container::HostConfig::Device,
1998
+ DockerEngine::Internal::AnyHash
1999
+ )
2000
+ end
2001
+
2002
+ sig { returns(T.nilable(String)) }
2003
+ attr_reader :cgroup_permissions
2004
+
2005
+ sig { params(cgroup_permissions: String).void }
2006
+ attr_writer :cgroup_permissions
2007
+
2008
+ sig { returns(T.nilable(String)) }
2009
+ attr_reader :path_in_container
2010
+
2011
+ sig { params(path_in_container: String).void }
2012
+ attr_writer :path_in_container
2013
+
2014
+ sig { returns(T.nilable(String)) }
2015
+ attr_reader :path_on_host
2016
+
2017
+ sig { params(path_on_host: String).void }
2018
+ attr_writer :path_on_host
2019
+
2020
+ # A device mapping between the host and container
2021
+ sig do
2022
+ params(
2023
+ cgroup_permissions: String,
2024
+ path_in_container: String,
2025
+ path_on_host: String
2026
+ ).returns(T.attached_class)
2027
+ end
2028
+ def self.new(
2029
+ cgroup_permissions: nil,
2030
+ path_in_container: nil,
2031
+ path_on_host: nil
2032
+ )
2033
+ end
2034
+
2035
+ sig do
2036
+ override.returns(
2037
+ {
2038
+ cgroup_permissions: String,
2039
+ path_in_container: String,
2040
+ path_on_host: String
2041
+ }
2042
+ )
2043
+ end
2044
+ def to_hash
2045
+ end
2046
+ end
2047
+
2048
+ # Isolation technology of the container. (Windows only)
2049
+ module Isolation
2050
+ extend DockerEngine::Internal::Type::Enum
2051
+
2052
+ TaggedSymbol =
2053
+ T.type_alias do
2054
+ T.all(Symbol, DockerEngine::Container::HostConfig::Isolation)
2055
+ end
2056
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
2057
+
2058
+ DEFAULT =
2059
+ T.let(
2060
+ :default,
2061
+ DockerEngine::Container::HostConfig::Isolation::TaggedSymbol
2062
+ )
2063
+ PROCESS =
2064
+ T.let(
2065
+ :process,
2066
+ DockerEngine::Container::HostConfig::Isolation::TaggedSymbol
2067
+ )
2068
+ HYPERV =
2069
+ T.let(
2070
+ :hyperv,
2071
+ DockerEngine::Container::HostConfig::Isolation::TaggedSymbol
2072
+ )
2073
+ EMPTY =
2074
+ T.let(
2075
+ :"",
2076
+ DockerEngine::Container::HostConfig::Isolation::TaggedSymbol
2077
+ )
2078
+
2079
+ sig do
2080
+ override.returns(
2081
+ T::Array[
2082
+ DockerEngine::Container::HostConfig::Isolation::TaggedSymbol
2083
+ ]
2084
+ )
2085
+ end
2086
+ def self.values
2087
+ end
2088
+ end
2089
+
2090
+ class LogConfig < DockerEngine::Internal::Type::BaseModel
2091
+ OrHash =
2092
+ T.type_alias do
2093
+ T.any(
2094
+ DockerEngine::Container::HostConfig::LogConfig,
2095
+ DockerEngine::Internal::AnyHash
2096
+ )
2097
+ end
2098
+
2099
+ # Driver-specific configuration options for the logging driver.
2100
+ sig { returns(T.nilable(T::Hash[Symbol, String])) }
2101
+ attr_reader :config
2102
+
2103
+ sig { params(config: T::Hash[Symbol, String]).void }
2104
+ attr_writer :config
2105
+
2106
+ # Name of the logging driver used for the container or "none" if logging is
2107
+ # disabled.
2108
+ sig do
2109
+ returns(
2110
+ T.nilable(
2111
+ DockerEngine::Container::HostConfig::LogConfig::Type::TaggedSymbol
2112
+ )
2113
+ )
2114
+ end
2115
+ attr_reader :type
2116
+
2117
+ sig do
2118
+ params(
2119
+ type:
2120
+ DockerEngine::Container::HostConfig::LogConfig::Type::OrSymbol
2121
+ ).void
2122
+ end
2123
+ attr_writer :type
2124
+
2125
+ # The logging configuration for this container
2126
+ sig do
2127
+ params(
2128
+ config: T::Hash[Symbol, String],
2129
+ type:
2130
+ DockerEngine::Container::HostConfig::LogConfig::Type::OrSymbol
2131
+ ).returns(T.attached_class)
2132
+ end
2133
+ def self.new(
2134
+ # Driver-specific configuration options for the logging driver.
2135
+ config: nil,
2136
+ # Name of the logging driver used for the container or "none" if logging is
2137
+ # disabled.
2138
+ type: nil
2139
+ )
2140
+ end
2141
+
2142
+ sig do
2143
+ override.returns(
2144
+ {
2145
+ config: T::Hash[Symbol, String],
2146
+ type:
2147
+ DockerEngine::Container::HostConfig::LogConfig::Type::TaggedSymbol
2148
+ }
2149
+ )
2150
+ end
2151
+ def to_hash
2152
+ end
2153
+
2154
+ # Name of the logging driver used for the container or "none" if logging is
2155
+ # disabled.
2156
+ module Type
2157
+ extend DockerEngine::Internal::Type::Enum
2158
+
2159
+ TaggedSymbol =
2160
+ T.type_alias do
2161
+ T.all(
2162
+ Symbol,
2163
+ DockerEngine::Container::HostConfig::LogConfig::Type
2164
+ )
2165
+ end
2166
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
2167
+
2168
+ LOCAL =
2169
+ T.let(
2170
+ :local,
2171
+ DockerEngine::Container::HostConfig::LogConfig::Type::TaggedSymbol
2172
+ )
2173
+ JSON_FILE =
2174
+ T.let(
2175
+ :"json-file",
2176
+ DockerEngine::Container::HostConfig::LogConfig::Type::TaggedSymbol
2177
+ )
2178
+ SYSLOG =
2179
+ T.let(
2180
+ :syslog,
2181
+ DockerEngine::Container::HostConfig::LogConfig::Type::TaggedSymbol
2182
+ )
2183
+ JOURNALD =
2184
+ T.let(
2185
+ :journald,
2186
+ DockerEngine::Container::HostConfig::LogConfig::Type::TaggedSymbol
2187
+ )
2188
+ GELF =
2189
+ T.let(
2190
+ :gelf,
2191
+ DockerEngine::Container::HostConfig::LogConfig::Type::TaggedSymbol
2192
+ )
2193
+ FLUENTD =
2194
+ T.let(
2195
+ :fluentd,
2196
+ DockerEngine::Container::HostConfig::LogConfig::Type::TaggedSymbol
2197
+ )
2198
+ AWSLOGS =
2199
+ T.let(
2200
+ :awslogs,
2201
+ DockerEngine::Container::HostConfig::LogConfig::Type::TaggedSymbol
2202
+ )
2203
+ SPLUNK =
2204
+ T.let(
2205
+ :splunk,
2206
+ DockerEngine::Container::HostConfig::LogConfig::Type::TaggedSymbol
2207
+ )
2208
+ ETWLOGS =
2209
+ T.let(
2210
+ :etwlogs,
2211
+ DockerEngine::Container::HostConfig::LogConfig::Type::TaggedSymbol
2212
+ )
2213
+ NONE =
2214
+ T.let(
2215
+ :none,
2216
+ DockerEngine::Container::HostConfig::LogConfig::Type::TaggedSymbol
2217
+ )
2218
+
2219
+ sig do
2220
+ override.returns(
2221
+ T::Array[
2222
+ DockerEngine::Container::HostConfig::LogConfig::Type::TaggedSymbol
2223
+ ]
2224
+ )
2225
+ end
2226
+ def self.values
2227
+ end
2228
+ end
2229
+ end
2230
+
2231
+ class Mount < DockerEngine::Internal::Type::BaseModel
2232
+ OrHash =
2233
+ T.type_alias do
2234
+ T.any(
2235
+ DockerEngine::Container::HostConfig::Mount,
2236
+ DockerEngine::Internal::AnyHash
2237
+ )
2238
+ end
2239
+
2240
+ # Optional configuration for the `bind` type.
2241
+ sig do
2242
+ returns(
2243
+ T.nilable(DockerEngine::Container::HostConfig::Mount::BindOptions)
2244
+ )
2245
+ end
2246
+ attr_reader :bind_options
2247
+
2248
+ sig do
2249
+ params(
2250
+ bind_options:
2251
+ DockerEngine::Container::HostConfig::Mount::BindOptions::OrHash
2252
+ ).void
2253
+ end
2254
+ attr_writer :bind_options
2255
+
2256
+ # The consistency requirement for the mount: `default`, `consistent`, `cached`, or
2257
+ # `delegated`.
2258
+ sig { returns(T.nilable(String)) }
2259
+ attr_reader :consistency
2260
+
2261
+ sig { params(consistency: String).void }
2262
+ attr_writer :consistency
2263
+
2264
+ # Optional configuration for the `image` type.
2265
+ sig do
2266
+ returns(
2267
+ T.nilable(
2268
+ DockerEngine::Container::HostConfig::Mount::ImageOptions
2269
+ )
2270
+ )
2271
+ end
2272
+ attr_reader :image_options
2273
+
2274
+ sig do
2275
+ params(
2276
+ image_options:
2277
+ DockerEngine::Container::HostConfig::Mount::ImageOptions::OrHash
2278
+ ).void
2279
+ end
2280
+ attr_writer :image_options
2281
+
2282
+ # Whether the mount should be read-only.
2283
+ sig { returns(T.nilable(T::Boolean)) }
2284
+ attr_reader :read_only
2285
+
2286
+ sig { params(read_only: T::Boolean).void }
2287
+ attr_writer :read_only
2288
+
2289
+ # Mount source (e.g. a volume name, a host path). The source cannot be specified
2290
+ # when using `Type=tmpfs`. For `Type=bind`, the source path must either exist, or
2291
+ # the `CreateMountpoint` must be set to `true` to create the source path on the
2292
+ # host if missing.
2293
+ #
2294
+ # For `Type=npipe`, the pipe must exist prior to creating the container.
2295
+ sig { returns(T.nilable(String)) }
2296
+ attr_reader :source
2297
+
2298
+ sig { params(source: String).void }
2299
+ attr_writer :source
2300
+
2301
+ # Container path.
2302
+ sig { returns(T.nilable(String)) }
2303
+ attr_reader :target
2304
+
2305
+ sig { params(target: String).void }
2306
+ attr_writer :target
2307
+
2308
+ # Optional configuration for the `tmpfs` type.
2309
+ sig do
2310
+ returns(
2311
+ T.nilable(
2312
+ DockerEngine::Container::HostConfig::Mount::TmpfsOptions
2313
+ )
2314
+ )
2315
+ end
2316
+ attr_reader :tmpfs_options
2317
+
2318
+ sig do
2319
+ params(
2320
+ tmpfs_options:
2321
+ DockerEngine::Container::HostConfig::Mount::TmpfsOptions::OrHash
2322
+ ).void
2323
+ end
2324
+ attr_writer :tmpfs_options
2325
+
2326
+ # The mount type. Available types:
2327
+ #
2328
+ # - `bind` a mount of a file or directory from the host into the container.
2329
+ # - `cluster` a Swarm cluster volume.
2330
+ # - `image` an OCI image.
2331
+ # - `npipe` a named pipe from the host into the container.
2332
+ # - `tmpfs` a `tmpfs`.
2333
+ # - `volume` a docker volume with the given `Name`.
2334
+ sig do
2335
+ returns(
2336
+ T.nilable(
2337
+ DockerEngine::Container::HostConfig::Mount::Type::TaggedSymbol
2338
+ )
2339
+ )
2340
+ end
2341
+ attr_reader :type
2342
+
2343
+ sig do
2344
+ params(
2345
+ type: DockerEngine::Container::HostConfig::Mount::Type::OrSymbol
2346
+ ).void
2347
+ end
2348
+ attr_writer :type
2349
+
2350
+ # Optional configuration for the `volume` type.
2351
+ sig do
2352
+ returns(
2353
+ T.nilable(
2354
+ DockerEngine::Container::HostConfig::Mount::VolumeOptions
2355
+ )
2356
+ )
2357
+ end
2358
+ attr_reader :volume_options
2359
+
2360
+ sig do
2361
+ params(
2362
+ volume_options:
2363
+ DockerEngine::Container::HostConfig::Mount::VolumeOptions::OrHash
2364
+ ).void
2365
+ end
2366
+ attr_writer :volume_options
2367
+
2368
+ sig do
2369
+ params(
2370
+ bind_options:
2371
+ DockerEngine::Container::HostConfig::Mount::BindOptions::OrHash,
2372
+ consistency: String,
2373
+ image_options:
2374
+ DockerEngine::Container::HostConfig::Mount::ImageOptions::OrHash,
2375
+ read_only: T::Boolean,
2376
+ source: String,
2377
+ target: String,
2378
+ tmpfs_options:
2379
+ DockerEngine::Container::HostConfig::Mount::TmpfsOptions::OrHash,
2380
+ type: DockerEngine::Container::HostConfig::Mount::Type::OrSymbol,
2381
+ volume_options:
2382
+ DockerEngine::Container::HostConfig::Mount::VolumeOptions::OrHash
2383
+ ).returns(T.attached_class)
2384
+ end
2385
+ def self.new(
2386
+ # Optional configuration for the `bind` type.
2387
+ bind_options: nil,
2388
+ # The consistency requirement for the mount: `default`, `consistent`, `cached`, or
2389
+ # `delegated`.
2390
+ consistency: nil,
2391
+ # Optional configuration for the `image` type.
2392
+ image_options: nil,
2393
+ # Whether the mount should be read-only.
2394
+ read_only: nil,
2395
+ # Mount source (e.g. a volume name, a host path). The source cannot be specified
2396
+ # when using `Type=tmpfs`. For `Type=bind`, the source path must either exist, or
2397
+ # the `CreateMountpoint` must be set to `true` to create the source path on the
2398
+ # host if missing.
2399
+ #
2400
+ # For `Type=npipe`, the pipe must exist prior to creating the container.
2401
+ source: nil,
2402
+ # Container path.
2403
+ target: nil,
2404
+ # Optional configuration for the `tmpfs` type.
2405
+ tmpfs_options: nil,
2406
+ # The mount type. Available types:
2407
+ #
2408
+ # - `bind` a mount of a file or directory from the host into the container.
2409
+ # - `cluster` a Swarm cluster volume.
2410
+ # - `image` an OCI image.
2411
+ # - `npipe` a named pipe from the host into the container.
2412
+ # - `tmpfs` a `tmpfs`.
2413
+ # - `volume` a docker volume with the given `Name`.
2414
+ type: nil,
2415
+ # Optional configuration for the `volume` type.
2416
+ volume_options: nil
2417
+ )
2418
+ end
2419
+
2420
+ sig do
2421
+ override.returns(
2422
+ {
2423
+ bind_options:
2424
+ DockerEngine::Container::HostConfig::Mount::BindOptions,
2425
+ consistency: String,
2426
+ image_options:
2427
+ DockerEngine::Container::HostConfig::Mount::ImageOptions,
2428
+ read_only: T::Boolean,
2429
+ source: String,
2430
+ target: String,
2431
+ tmpfs_options:
2432
+ DockerEngine::Container::HostConfig::Mount::TmpfsOptions,
2433
+ type:
2434
+ DockerEngine::Container::HostConfig::Mount::Type::TaggedSymbol,
2435
+ volume_options:
2436
+ DockerEngine::Container::HostConfig::Mount::VolumeOptions
2437
+ }
2438
+ )
2439
+ end
2440
+ def to_hash
2441
+ end
2442
+
2443
+ class BindOptions < DockerEngine::Internal::Type::BaseModel
2444
+ OrHash =
2445
+ T.type_alias do
2446
+ T.any(
2447
+ DockerEngine::Container::HostConfig::Mount::BindOptions,
2448
+ DockerEngine::Internal::AnyHash
2449
+ )
2450
+ end
2451
+
2452
+ # Create mount point on host if missing
2453
+ sig { returns(T.nilable(T::Boolean)) }
2454
+ attr_reader :create_mountpoint
2455
+
2456
+ sig { params(create_mountpoint: T::Boolean).void }
2457
+ attr_writer :create_mountpoint
2458
+
2459
+ # Disable recursive bind mount.
2460
+ sig { returns(T.nilable(T::Boolean)) }
2461
+ attr_reader :non_recursive
2462
+
2463
+ sig { params(non_recursive: T::Boolean).void }
2464
+ attr_writer :non_recursive
2465
+
2466
+ # A propagation mode with the value `[r]private`, `[r]shared`, or `[r]slave`.
2467
+ sig do
2468
+ returns(
2469
+ T.nilable(
2470
+ DockerEngine::Container::HostConfig::Mount::BindOptions::Propagation::TaggedSymbol
2471
+ )
2472
+ )
2473
+ end
2474
+ attr_reader :propagation
2475
+
2476
+ sig do
2477
+ params(
2478
+ propagation:
2479
+ DockerEngine::Container::HostConfig::Mount::BindOptions::Propagation::OrSymbol
2480
+ ).void
2481
+ end
2482
+ attr_writer :propagation
2483
+
2484
+ # Raise an error if the mount cannot be made recursively read-only.
2485
+ sig { returns(T.nilable(T::Boolean)) }
2486
+ attr_reader :read_only_force_recursive
2487
+
2488
+ sig { params(read_only_force_recursive: T::Boolean).void }
2489
+ attr_writer :read_only_force_recursive
2490
+
2491
+ # Make the mount non-recursively read-only, but still leave the mount recursive
2492
+ # (unless NonRecursive is set to `true` in conjunction).
2493
+ #
2494
+ # Added in v1.44, before that version all read-only mounts were non-recursive by
2495
+ # default. To match the previous behaviour this will default to `true` for clients
2496
+ # on versions prior to v1.44.
2497
+ sig { returns(T.nilable(T::Boolean)) }
2498
+ attr_reader :read_only_non_recursive
2499
+
2500
+ sig { params(read_only_non_recursive: T::Boolean).void }
2501
+ attr_writer :read_only_non_recursive
2502
+
2503
+ # Optional configuration for the `bind` type.
2504
+ sig do
2505
+ params(
2506
+ create_mountpoint: T::Boolean,
2507
+ non_recursive: T::Boolean,
2508
+ propagation:
2509
+ DockerEngine::Container::HostConfig::Mount::BindOptions::Propagation::OrSymbol,
2510
+ read_only_force_recursive: T::Boolean,
2511
+ read_only_non_recursive: T::Boolean
2512
+ ).returns(T.attached_class)
2513
+ end
2514
+ def self.new(
2515
+ # Create mount point on host if missing
2516
+ create_mountpoint: nil,
2517
+ # Disable recursive bind mount.
2518
+ non_recursive: nil,
2519
+ # A propagation mode with the value `[r]private`, `[r]shared`, or `[r]slave`.
2520
+ propagation: nil,
2521
+ # Raise an error if the mount cannot be made recursively read-only.
2522
+ read_only_force_recursive: nil,
2523
+ # Make the mount non-recursively read-only, but still leave the mount recursive
2524
+ # (unless NonRecursive is set to `true` in conjunction).
2525
+ #
2526
+ # Added in v1.44, before that version all read-only mounts were non-recursive by
2527
+ # default. To match the previous behaviour this will default to `true` for clients
2528
+ # on versions prior to v1.44.
2529
+ read_only_non_recursive: nil
2530
+ )
2531
+ end
2532
+
2533
+ sig do
2534
+ override.returns(
2535
+ {
2536
+ create_mountpoint: T::Boolean,
2537
+ non_recursive: T::Boolean,
2538
+ propagation:
2539
+ DockerEngine::Container::HostConfig::Mount::BindOptions::Propagation::TaggedSymbol,
2540
+ read_only_force_recursive: T::Boolean,
2541
+ read_only_non_recursive: T::Boolean
2542
+ }
2543
+ )
2544
+ end
2545
+ def to_hash
2546
+ end
2547
+
2548
+ # A propagation mode with the value `[r]private`, `[r]shared`, or `[r]slave`.
2549
+ module Propagation
2550
+ extend DockerEngine::Internal::Type::Enum
2551
+
2552
+ TaggedSymbol =
2553
+ T.type_alias do
2554
+ T.all(
2555
+ Symbol,
2556
+ DockerEngine::Container::HostConfig::Mount::BindOptions::Propagation
2557
+ )
2558
+ end
2559
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
2560
+
2561
+ PRIVATE =
2562
+ T.let(
2563
+ :private,
2564
+ DockerEngine::Container::HostConfig::Mount::BindOptions::Propagation::TaggedSymbol
2565
+ )
2566
+ RPRIVATE =
2567
+ T.let(
2568
+ :rprivate,
2569
+ DockerEngine::Container::HostConfig::Mount::BindOptions::Propagation::TaggedSymbol
2570
+ )
2571
+ SHARED =
2572
+ T.let(
2573
+ :shared,
2574
+ DockerEngine::Container::HostConfig::Mount::BindOptions::Propagation::TaggedSymbol
2575
+ )
2576
+ RSHARED =
2577
+ T.let(
2578
+ :rshared,
2579
+ DockerEngine::Container::HostConfig::Mount::BindOptions::Propagation::TaggedSymbol
2580
+ )
2581
+ SLAVE =
2582
+ T.let(
2583
+ :slave,
2584
+ DockerEngine::Container::HostConfig::Mount::BindOptions::Propagation::TaggedSymbol
2585
+ )
2586
+ RSLAVE =
2587
+ T.let(
2588
+ :rslave,
2589
+ DockerEngine::Container::HostConfig::Mount::BindOptions::Propagation::TaggedSymbol
2590
+ )
2591
+
2592
+ sig do
2593
+ override.returns(
2594
+ T::Array[
2595
+ DockerEngine::Container::HostConfig::Mount::BindOptions::Propagation::TaggedSymbol
2596
+ ]
2597
+ )
2598
+ end
2599
+ def self.values
2600
+ end
2601
+ end
2602
+ end
2603
+
2604
+ class ImageOptions < DockerEngine::Internal::Type::BaseModel
2605
+ OrHash =
2606
+ T.type_alias do
2607
+ T.any(
2608
+ DockerEngine::Container::HostConfig::Mount::ImageOptions,
2609
+ DockerEngine::Internal::AnyHash
2610
+ )
2611
+ end
2612
+
2613
+ # Source path inside the image. Must be relative without any back traversals.
2614
+ sig { returns(T.nilable(String)) }
2615
+ attr_reader :subpath
2616
+
2617
+ sig { params(subpath: String).void }
2618
+ attr_writer :subpath
2619
+
2620
+ # Optional configuration for the `image` type.
2621
+ sig { params(subpath: String).returns(T.attached_class) }
2622
+ def self.new(
2623
+ # Source path inside the image. Must be relative without any back traversals.
2624
+ subpath: nil
2625
+ )
2626
+ end
2627
+
2628
+ sig { override.returns({ subpath: String }) }
2629
+ def to_hash
2630
+ end
2631
+ end
2632
+
2633
+ class TmpfsOptions < DockerEngine::Internal::Type::BaseModel
2634
+ OrHash =
2635
+ T.type_alias do
2636
+ T.any(
2637
+ DockerEngine::Container::HostConfig::Mount::TmpfsOptions,
2638
+ DockerEngine::Internal::AnyHash
2639
+ )
2640
+ end
2641
+
2642
+ # The permission mode for the tmpfs mount in an integer. The value must not be in
2643
+ # octal format (e.g. 755) but rather the decimal representation of the octal value
2644
+ # (e.g. 493).
2645
+ sig { returns(T.nilable(Integer)) }
2646
+ attr_reader :mode
2647
+
2648
+ sig { params(mode: Integer).void }
2649
+ attr_writer :mode
2650
+
2651
+ # The options to be passed to the tmpfs mount. An array of arrays. Flag options
2652
+ # should be provided as 1-length arrays. Other types should be provided as as
2653
+ # 2-length arrays, where the first item is the key and the second the value.
2654
+ sig { returns(T.nilable(T::Array[T::Array[String]])) }
2655
+ attr_reader :options
2656
+
2657
+ sig { params(options: T::Array[T::Array[String]]).void }
2658
+ attr_writer :options
2659
+
2660
+ # The size for the tmpfs mount in bytes.
2661
+ sig { returns(T.nilable(Integer)) }
2662
+ attr_reader :size_bytes
2663
+
2664
+ sig { params(size_bytes: Integer).void }
2665
+ attr_writer :size_bytes
2666
+
2667
+ # Optional configuration for the `tmpfs` type.
2668
+ sig do
2669
+ params(
2670
+ mode: Integer,
2671
+ options: T::Array[T::Array[String]],
2672
+ size_bytes: Integer
2673
+ ).returns(T.attached_class)
2674
+ end
2675
+ def self.new(
2676
+ # The permission mode for the tmpfs mount in an integer. The value must not be in
2677
+ # octal format (e.g. 755) but rather the decimal representation of the octal value
2678
+ # (e.g. 493).
2679
+ mode: nil,
2680
+ # The options to be passed to the tmpfs mount. An array of arrays. Flag options
2681
+ # should be provided as 1-length arrays. Other types should be provided as as
2682
+ # 2-length arrays, where the first item is the key and the second the value.
2683
+ options: nil,
2684
+ # The size for the tmpfs mount in bytes.
2685
+ size_bytes: nil
2686
+ )
2687
+ end
2688
+
2689
+ sig do
2690
+ override.returns(
2691
+ {
2692
+ mode: Integer,
2693
+ options: T::Array[T::Array[String]],
2694
+ size_bytes: Integer
2695
+ }
2696
+ )
2697
+ end
2698
+ def to_hash
2699
+ end
2700
+ end
2701
+
2702
+ # The mount type. Available types:
2703
+ #
2704
+ # - `bind` a mount of a file or directory from the host into the container.
2705
+ # - `cluster` a Swarm cluster volume.
2706
+ # - `image` an OCI image.
2707
+ # - `npipe` a named pipe from the host into the container.
2708
+ # - `tmpfs` a `tmpfs`.
2709
+ # - `volume` a docker volume with the given `Name`.
2710
+ module Type
2711
+ extend DockerEngine::Internal::Type::Enum
2712
+
2713
+ TaggedSymbol =
2714
+ T.type_alias do
2715
+ T.all(Symbol, DockerEngine::Container::HostConfig::Mount::Type)
2716
+ end
2717
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
2718
+
2719
+ BIND =
2720
+ T.let(
2721
+ :bind,
2722
+ DockerEngine::Container::HostConfig::Mount::Type::TaggedSymbol
2723
+ )
2724
+ CLUSTER =
2725
+ T.let(
2726
+ :cluster,
2727
+ DockerEngine::Container::HostConfig::Mount::Type::TaggedSymbol
2728
+ )
2729
+ IMAGE =
2730
+ T.let(
2731
+ :image,
2732
+ DockerEngine::Container::HostConfig::Mount::Type::TaggedSymbol
2733
+ )
2734
+ NPIPE =
2735
+ T.let(
2736
+ :npipe,
2737
+ DockerEngine::Container::HostConfig::Mount::Type::TaggedSymbol
2738
+ )
2739
+ TMPFS =
2740
+ T.let(
2741
+ :tmpfs,
2742
+ DockerEngine::Container::HostConfig::Mount::Type::TaggedSymbol
2743
+ )
2744
+ VOLUME =
2745
+ T.let(
2746
+ :volume,
2747
+ DockerEngine::Container::HostConfig::Mount::Type::TaggedSymbol
2748
+ )
2749
+
2750
+ sig do
2751
+ override.returns(
2752
+ T::Array[
2753
+ DockerEngine::Container::HostConfig::Mount::Type::TaggedSymbol
2754
+ ]
2755
+ )
2756
+ end
2757
+ def self.values
2758
+ end
2759
+ end
2760
+
2761
+ class VolumeOptions < DockerEngine::Internal::Type::BaseModel
2762
+ OrHash =
2763
+ T.type_alias do
2764
+ T.any(
2765
+ DockerEngine::Container::HostConfig::Mount::VolumeOptions,
2766
+ DockerEngine::Internal::AnyHash
2767
+ )
2768
+ end
2769
+
2770
+ # Map of driver specific options
2771
+ sig do
2772
+ returns(
2773
+ T.nilable(
2774
+ DockerEngine::Container::HostConfig::Mount::VolumeOptions::DriverConfig
2775
+ )
2776
+ )
2777
+ end
2778
+ attr_reader :driver_config
2779
+
2780
+ sig do
2781
+ params(
2782
+ driver_config:
2783
+ DockerEngine::Container::HostConfig::Mount::VolumeOptions::DriverConfig::OrHash
2784
+ ).void
2785
+ end
2786
+ attr_writer :driver_config
2787
+
2788
+ # User-defined key/value metadata.
2789
+ sig { returns(T.nilable(T::Hash[Symbol, String])) }
2790
+ attr_reader :labels
2791
+
2792
+ sig { params(labels: T::Hash[Symbol, String]).void }
2793
+ attr_writer :labels
2794
+
2795
+ # Populate volume with data from the target.
2796
+ sig { returns(T.nilable(T::Boolean)) }
2797
+ attr_reader :no_copy
2798
+
2799
+ sig { params(no_copy: T::Boolean).void }
2800
+ attr_writer :no_copy
2801
+
2802
+ # Source path inside the volume. Must be relative without any back traversals.
2803
+ sig { returns(T.nilable(String)) }
2804
+ attr_reader :subpath
2805
+
2806
+ sig { params(subpath: String).void }
2807
+ attr_writer :subpath
2808
+
2809
+ # Optional configuration for the `volume` type.
2810
+ sig do
2811
+ params(
2812
+ driver_config:
2813
+ DockerEngine::Container::HostConfig::Mount::VolumeOptions::DriverConfig::OrHash,
2814
+ labels: T::Hash[Symbol, String],
2815
+ no_copy: T::Boolean,
2816
+ subpath: String
2817
+ ).returns(T.attached_class)
2818
+ end
2819
+ def self.new(
2820
+ # Map of driver specific options
2821
+ driver_config: nil,
2822
+ # User-defined key/value metadata.
2823
+ labels: nil,
2824
+ # Populate volume with data from the target.
2825
+ no_copy: nil,
2826
+ # Source path inside the volume. Must be relative without any back traversals.
2827
+ subpath: nil
2828
+ )
2829
+ end
2830
+
2831
+ sig do
2832
+ override.returns(
2833
+ {
2834
+ driver_config:
2835
+ DockerEngine::Container::HostConfig::Mount::VolumeOptions::DriverConfig,
2836
+ labels: T::Hash[Symbol, String],
2837
+ no_copy: T::Boolean,
2838
+ subpath: String
2839
+ }
2840
+ )
2841
+ end
2842
+ def to_hash
2843
+ end
2844
+
2845
+ class DriverConfig < DockerEngine::Internal::Type::BaseModel
2846
+ OrHash =
2847
+ T.type_alias do
2848
+ T.any(
2849
+ DockerEngine::Container::HostConfig::Mount::VolumeOptions::DriverConfig,
2850
+ DockerEngine::Internal::AnyHash
2851
+ )
2852
+ end
2853
+
2854
+ # Name of the driver to use to create the volume.
2855
+ sig { returns(T.nilable(String)) }
2856
+ attr_reader :name
2857
+
2858
+ sig { params(name: String).void }
2859
+ attr_writer :name
2860
+
2861
+ # key/value map of driver specific options.
2862
+ sig { returns(T.nilable(T::Hash[Symbol, String])) }
2863
+ attr_reader :options
2864
+
2865
+ sig { params(options: T::Hash[Symbol, String]).void }
2866
+ attr_writer :options
2867
+
2868
+ # Map of driver specific options
2869
+ sig do
2870
+ params(name: String, options: T::Hash[Symbol, String]).returns(
2871
+ T.attached_class
2872
+ )
2873
+ end
2874
+ def self.new(
2875
+ # Name of the driver to use to create the volume.
2876
+ name: nil,
2877
+ # key/value map of driver specific options.
2878
+ options: nil
2879
+ )
2880
+ end
2881
+
2882
+ sig do
2883
+ override.returns(
2884
+ { name: String, options: T::Hash[Symbol, String] }
2885
+ )
2886
+ end
2887
+ def to_hash
2888
+ end
2889
+ end
2890
+ end
2891
+ end
2892
+
2893
+ class PortBinding < DockerEngine::Internal::Type::BaseModel
2894
+ OrHash =
2895
+ T.type_alias do
2896
+ T.any(
2897
+ DockerEngine::Container::HostConfig::PortBinding,
2898
+ DockerEngine::Internal::AnyHash
2899
+ )
2900
+ end
2901
+
2902
+ # Host IP address that the container's port is mapped to.
2903
+ sig { returns(T.nilable(String)) }
2904
+ attr_reader :host_ip
2905
+
2906
+ sig { params(host_ip: String).void }
2907
+ attr_writer :host_ip
2908
+
2909
+ # Host port number that the container's port is mapped to.
2910
+ sig { returns(T.nilable(String)) }
2911
+ attr_reader :host_port
2912
+
2913
+ sig { params(host_port: String).void }
2914
+ attr_writer :host_port
2915
+
2916
+ # PortBinding represents a binding between a host IP address and a host port.
2917
+ sig do
2918
+ params(host_ip: String, host_port: String).returns(T.attached_class)
2919
+ end
2920
+ def self.new(
2921
+ # Host IP address that the container's port is mapped to.
2922
+ host_ip: nil,
2923
+ # Host port number that the container's port is mapped to.
2924
+ host_port: nil
2925
+ )
2926
+ end
2927
+
2928
+ sig { override.returns({ host_ip: String, host_port: String }) }
2929
+ def to_hash
2930
+ end
2931
+ end
2932
+
2933
+ class RestartPolicy < DockerEngine::Internal::Type::BaseModel
2934
+ OrHash =
2935
+ T.type_alias do
2936
+ T.any(
2937
+ DockerEngine::Container::HostConfig::RestartPolicy,
2938
+ DockerEngine::Internal::AnyHash
2939
+ )
2940
+ end
2941
+
2942
+ # If `on-failure` is used, the number of times to retry before giving up.
2943
+ sig { returns(T.nilable(Integer)) }
2944
+ attr_reader :maximum_retry_count
2945
+
2946
+ sig { params(maximum_retry_count: Integer).void }
2947
+ attr_writer :maximum_retry_count
2948
+
2949
+ # - Empty string means not to restart
2950
+ # - `no` Do not automatically restart
2951
+ # - `always` Always restart
2952
+ # - `unless-stopped` Restart always except when the user has manually stopped the
2953
+ # container
2954
+ # - `on-failure` Restart only when the container exit code is non-zero
2955
+ sig do
2956
+ returns(
2957
+ T.nilable(
2958
+ DockerEngine::Container::HostConfig::RestartPolicy::Name::TaggedSymbol
2959
+ )
2960
+ )
2961
+ end
2962
+ attr_reader :name
2963
+
2964
+ sig do
2965
+ params(
2966
+ name:
2967
+ DockerEngine::Container::HostConfig::RestartPolicy::Name::OrSymbol
2968
+ ).void
2969
+ end
2970
+ attr_writer :name
2971
+
2972
+ # The behavior to apply when the container exits. The default is not to restart.
2973
+ #
2974
+ # An ever increasing delay (double the previous delay, starting at 100ms) is added
2975
+ # before each restart to prevent flooding the server.
2976
+ sig do
2977
+ params(
2978
+ maximum_retry_count: Integer,
2979
+ name:
2980
+ DockerEngine::Container::HostConfig::RestartPolicy::Name::OrSymbol
2981
+ ).returns(T.attached_class)
2982
+ end
2983
+ def self.new(
2984
+ # If `on-failure` is used, the number of times to retry before giving up.
2985
+ maximum_retry_count: nil,
2986
+ # - Empty string means not to restart
2987
+ # - `no` Do not automatically restart
2988
+ # - `always` Always restart
2989
+ # - `unless-stopped` Restart always except when the user has manually stopped the
2990
+ # container
2991
+ # - `on-failure` Restart only when the container exit code is non-zero
2992
+ name: nil
2993
+ )
2994
+ end
2995
+
2996
+ sig do
2997
+ override.returns(
2998
+ {
2999
+ maximum_retry_count: Integer,
3000
+ name:
3001
+ DockerEngine::Container::HostConfig::RestartPolicy::Name::TaggedSymbol
3002
+ }
3003
+ )
3004
+ end
3005
+ def to_hash
3006
+ end
3007
+
3008
+ # - Empty string means not to restart
3009
+ # - `no` Do not automatically restart
3010
+ # - `always` Always restart
3011
+ # - `unless-stopped` Restart always except when the user has manually stopped the
3012
+ # container
3013
+ # - `on-failure` Restart only when the container exit code is non-zero
3014
+ module Name
3015
+ extend DockerEngine::Internal::Type::Enum
3016
+
3017
+ TaggedSymbol =
3018
+ T.type_alias do
3019
+ T.all(
3020
+ Symbol,
3021
+ DockerEngine::Container::HostConfig::RestartPolicy::Name
3022
+ )
3023
+ end
3024
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
3025
+
3026
+ EMPTY =
3027
+ T.let(
3028
+ :"",
3029
+ DockerEngine::Container::HostConfig::RestartPolicy::Name::TaggedSymbol
3030
+ )
3031
+ NO =
3032
+ T.let(
3033
+ :no,
3034
+ DockerEngine::Container::HostConfig::RestartPolicy::Name::TaggedSymbol
3035
+ )
3036
+ ALWAYS =
3037
+ T.let(
3038
+ :always,
3039
+ DockerEngine::Container::HostConfig::RestartPolicy::Name::TaggedSymbol
3040
+ )
3041
+ UNLESS_STOPPED =
3042
+ T.let(
3043
+ :"unless-stopped",
3044
+ DockerEngine::Container::HostConfig::RestartPolicy::Name::TaggedSymbol
3045
+ )
3046
+ ON_FAILURE =
3047
+ T.let(
3048
+ :"on-failure",
3049
+ DockerEngine::Container::HostConfig::RestartPolicy::Name::TaggedSymbol
3050
+ )
3051
+
3052
+ sig do
3053
+ override.returns(
3054
+ T::Array[
3055
+ DockerEngine::Container::HostConfig::RestartPolicy::Name::TaggedSymbol
3056
+ ]
3057
+ )
3058
+ end
3059
+ def self.values
3060
+ end
3061
+ end
3062
+ end
3063
+
3064
+ class Ulimit < DockerEngine::Internal::Type::BaseModel
3065
+ OrHash =
3066
+ T.type_alias do
3067
+ T.any(
3068
+ DockerEngine::Container::HostConfig::Ulimit,
3069
+ DockerEngine::Internal::AnyHash
3070
+ )
3071
+ end
3072
+
3073
+ # Hard limit
3074
+ sig { returns(T.nilable(Integer)) }
3075
+ attr_reader :hard
3076
+
3077
+ sig { params(hard: Integer).void }
3078
+ attr_writer :hard
3079
+
3080
+ # Name of ulimit
3081
+ sig { returns(T.nilable(String)) }
3082
+ attr_reader :name
3083
+
3084
+ sig { params(name: String).void }
3085
+ attr_writer :name
3086
+
3087
+ # Soft limit
3088
+ sig { returns(T.nilable(Integer)) }
3089
+ attr_reader :soft
3090
+
3091
+ sig { params(soft: Integer).void }
3092
+ attr_writer :soft
3093
+
3094
+ sig do
3095
+ params(hard: Integer, name: String, soft: Integer).returns(
3096
+ T.attached_class
3097
+ )
3098
+ end
3099
+ def self.new(
3100
+ # Hard limit
3101
+ hard: nil,
3102
+ # Name of ulimit
3103
+ name: nil,
3104
+ # Soft limit
3105
+ soft: nil
3106
+ )
3107
+ end
3108
+
3109
+ sig do
3110
+ override.returns({ hard: Integer, name: String, soft: Integer })
3111
+ end
3112
+ def to_hash
3113
+ end
3114
+ end
3115
+ end
3116
+
3117
+ class ImageManifestDescriptor < DockerEngine::Internal::Type::BaseModel
3118
+ OrHash =
3119
+ T.type_alias do
3120
+ T.any(
3121
+ DockerEngine::Container::ImageManifestDescriptor,
3122
+ DockerEngine::Internal::AnyHash
3123
+ )
3124
+ end
3125
+
3126
+ # Arbitrary metadata relating to the targeted content.
3127
+ sig { returns(T.nilable(T::Hash[Symbol, String])) }
3128
+ attr_accessor :annotations
3129
+
3130
+ # ArtifactType is the IANA media type of this artifact.
3131
+ sig { returns(T.nilable(String)) }
3132
+ attr_accessor :artifact_type
3133
+
3134
+ # Data is an embedding of the targeted content. This is encoded as a base64 string
3135
+ # when marshalled to JSON (automatically, by encoding/json). If present, Data can
3136
+ # be used directly to avoid fetching the targeted content.
3137
+ sig { returns(T.nilable(String)) }
3138
+ attr_accessor :data
3139
+
3140
+ # The digest of the targeted content.
3141
+ sig { returns(T.nilable(String)) }
3142
+ attr_reader :digest
3143
+
3144
+ sig { params(digest: String).void }
3145
+ attr_writer :digest
3146
+
3147
+ # The media type of the object this schema refers to.
3148
+ sig { returns(T.nilable(String)) }
3149
+ attr_reader :media_type
3150
+
3151
+ sig { params(media_type: String).void }
3152
+ attr_writer :media_type
3153
+
3154
+ # Describes the platform which the image in the manifest runs on, as defined in
3155
+ # the
3156
+ # [OCI Image Index Specification](https://github.com/opencontainers/image-spec/blob/v1.0.1/image-index.md).
3157
+ sig do
3158
+ returns(
3159
+ T.nilable(
3160
+ DockerEngine::Container::ImageManifestDescriptor::Platform
3161
+ )
3162
+ )
3163
+ end
3164
+ attr_reader :platform
3165
+
3166
+ sig do
3167
+ params(
3168
+ platform:
3169
+ T.nilable(
3170
+ DockerEngine::Container::ImageManifestDescriptor::Platform::OrHash
3171
+ )
3172
+ ).void
3173
+ end
3174
+ attr_writer :platform
3175
+
3176
+ # The size in bytes of the blob.
3177
+ sig { returns(T.nilable(Integer)) }
3178
+ attr_reader :size
3179
+
3180
+ sig { params(size: Integer).void }
3181
+ attr_writer :size
3182
+
3183
+ # List of URLs from which this object MAY be downloaded.
3184
+ sig { returns(T.nilable(T::Array[String])) }
3185
+ attr_accessor :urls
3186
+
3187
+ # A descriptor struct containing digest, media type, and size, as defined in the
3188
+ # [OCI Content Descriptors Specification](https://github.com/opencontainers/image-spec/blob/v1.0.1/descriptor.md).
3189
+ sig do
3190
+ params(
3191
+ annotations: T.nilable(T::Hash[Symbol, String]),
3192
+ artifact_type: T.nilable(String),
3193
+ data: T.nilable(String),
3194
+ digest: String,
3195
+ media_type: String,
3196
+ platform:
3197
+ T.nilable(
3198
+ DockerEngine::Container::ImageManifestDescriptor::Platform::OrHash
3199
+ ),
3200
+ size: Integer,
3201
+ urls: T.nilable(T::Array[String])
3202
+ ).returns(T.attached_class)
3203
+ end
3204
+ def self.new(
3205
+ # Arbitrary metadata relating to the targeted content.
3206
+ annotations: nil,
3207
+ # ArtifactType is the IANA media type of this artifact.
3208
+ artifact_type: nil,
3209
+ # Data is an embedding of the targeted content. This is encoded as a base64 string
3210
+ # when marshalled to JSON (automatically, by encoding/json). If present, Data can
3211
+ # be used directly to avoid fetching the targeted content.
3212
+ data: nil,
3213
+ # The digest of the targeted content.
3214
+ digest: nil,
3215
+ # The media type of the object this schema refers to.
3216
+ media_type: nil,
3217
+ # Describes the platform which the image in the manifest runs on, as defined in
3218
+ # the
3219
+ # [OCI Image Index Specification](https://github.com/opencontainers/image-spec/blob/v1.0.1/image-index.md).
3220
+ platform: nil,
3221
+ # The size in bytes of the blob.
3222
+ size: nil,
3223
+ # List of URLs from which this object MAY be downloaded.
3224
+ urls: nil
3225
+ )
3226
+ end
3227
+
3228
+ sig do
3229
+ override.returns(
3230
+ {
3231
+ annotations: T.nilable(T::Hash[Symbol, String]),
3232
+ artifact_type: T.nilable(String),
3233
+ data: T.nilable(String),
3234
+ digest: String,
3235
+ media_type: String,
3236
+ platform:
3237
+ T.nilable(
3238
+ DockerEngine::Container::ImageManifestDescriptor::Platform
3239
+ ),
3240
+ size: Integer,
3241
+ urls: T.nilable(T::Array[String])
3242
+ }
3243
+ )
3244
+ end
3245
+ def to_hash
3246
+ end
3247
+
3248
+ class Platform < DockerEngine::Internal::Type::BaseModel
3249
+ OrHash =
3250
+ T.type_alias do
3251
+ T.any(
3252
+ DockerEngine::Container::ImageManifestDescriptor::Platform,
3253
+ DockerEngine::Internal::AnyHash
3254
+ )
3255
+ end
3256
+
3257
+ # The CPU architecture, for example `amd64` or `ppc64`.
3258
+ sig { returns(T.nilable(String)) }
3259
+ attr_reader :architecture
3260
+
3261
+ sig { params(architecture: String).void }
3262
+ attr_writer :architecture
3263
+
3264
+ # The operating system, for example `linux` or `windows`.
3265
+ sig { returns(T.nilable(String)) }
3266
+ attr_reader :os
3267
+
3268
+ sig { params(os: String).void }
3269
+ attr_writer :os
3270
+
3271
+ # Optional field specifying an array of strings, each listing a required OS
3272
+ # feature (for example on Windows `win32k`).
3273
+ sig { returns(T.nilable(T::Array[String])) }
3274
+ attr_reader :os_features
3275
+
3276
+ sig { params(os_features: T::Array[String]).void }
3277
+ attr_writer :os_features
3278
+
3279
+ # Optional field specifying the operating system version, for example on Windows
3280
+ # `10.0.19041.1165`.
3281
+ sig { returns(T.nilable(String)) }
3282
+ attr_reader :os_version
3283
+
3284
+ sig { params(os_version: String).void }
3285
+ attr_writer :os_version
3286
+
3287
+ # Optional field specifying a variant of the CPU, for example `v7` to specify
3288
+ # ARMv7 when architecture is `arm`.
3289
+ sig { returns(T.nilable(String)) }
3290
+ attr_reader :variant
3291
+
3292
+ sig { params(variant: String).void }
3293
+ attr_writer :variant
3294
+
3295
+ # Describes the platform which the image in the manifest runs on, as defined in
3296
+ # the
3297
+ # [OCI Image Index Specification](https://github.com/opencontainers/image-spec/blob/v1.0.1/image-index.md).
3298
+ sig do
3299
+ params(
3300
+ architecture: String,
3301
+ os: String,
3302
+ os_features: T::Array[String],
3303
+ os_version: String,
3304
+ variant: String
3305
+ ).returns(T.attached_class)
3306
+ end
3307
+ def self.new(
3308
+ # The CPU architecture, for example `amd64` or `ppc64`.
3309
+ architecture: nil,
3310
+ # The operating system, for example `linux` or `windows`.
3311
+ os: nil,
3312
+ # Optional field specifying an array of strings, each listing a required OS
3313
+ # feature (for example on Windows `win32k`).
3314
+ os_features: nil,
3315
+ # Optional field specifying the operating system version, for example on Windows
3316
+ # `10.0.19041.1165`.
3317
+ os_version: nil,
3318
+ # Optional field specifying a variant of the CPU, for example `v7` to specify
3319
+ # ARMv7 when architecture is `arm`.
3320
+ variant: nil
3321
+ )
3322
+ end
3323
+
3324
+ sig do
3325
+ override.returns(
3326
+ {
3327
+ architecture: String,
3328
+ os: String,
3329
+ os_features: T::Array[String],
3330
+ os_version: String,
3331
+ variant: String
3332
+ }
3333
+ )
3334
+ end
3335
+ def to_hash
3336
+ end
3337
+ end
3338
+ end
3339
+
3340
+ class Mount < DockerEngine::Internal::Type::BaseModel
3341
+ OrHash =
3342
+ T.type_alias do
3343
+ T.any(
3344
+ DockerEngine::Container::Mount,
3345
+ DockerEngine::Internal::AnyHash
3346
+ )
3347
+ end
3348
+
3349
+ # Destination is the path relative to the container root (`/`) where the `Source`
3350
+ # is mounted inside the container.
3351
+ sig { returns(T.nilable(String)) }
3352
+ attr_reader :destination
3353
+
3354
+ sig { params(destination: String).void }
3355
+ attr_writer :destination
3356
+
3357
+ # Driver is the volume driver used to create the volume (if it is a volume).
3358
+ sig { returns(T.nilable(String)) }
3359
+ attr_reader :driver
3360
+
3361
+ sig { params(driver: String).void }
3362
+ attr_writer :driver
3363
+
3364
+ # Mode is a comma separated list of options supplied by the user when creating the
3365
+ # bind/volume mount.
3366
+ #
3367
+ # The default is platform-specific (`"z"` on Linux, empty on Windows).
3368
+ sig { returns(T.nilable(String)) }
3369
+ attr_reader :mode
3370
+
3371
+ sig { params(mode: String).void }
3372
+ attr_writer :mode
3373
+
3374
+ # Name is the name reference to the underlying data defined by `Source` e.g., the
3375
+ # volume name.
3376
+ sig { returns(T.nilable(String)) }
3377
+ attr_reader :name
3378
+
3379
+ sig { params(name: String).void }
3380
+ attr_writer :name
3381
+
3382
+ # Propagation describes how mounts are propagated from the host into the mount
3383
+ # point, and vice-versa. Refer to the
3384
+ # [Linux kernel documentation](https://www.kernel.org/doc/Documentation/filesystems/sharedsubtree.txt)
3385
+ # for details. This field is not used on Windows.
3386
+ sig { returns(T.nilable(String)) }
3387
+ attr_reader :propagation
3388
+
3389
+ sig { params(propagation: String).void }
3390
+ attr_writer :propagation
3391
+
3392
+ # Whether the mount is mounted writable (read-write).
3393
+ sig { returns(T.nilable(T::Boolean)) }
3394
+ attr_reader :rw
3395
+
3396
+ sig { params(rw: T::Boolean).void }
3397
+ attr_writer :rw
3398
+
3399
+ # Source location of the mount.
3400
+ #
3401
+ # For volumes, this contains the storage location of the volume (within
3402
+ # `/var/lib/docker/volumes/`). For bind-mounts, and `npipe`, this contains the
3403
+ # source (host) part of the bind-mount. For `tmpfs` mount points, this field is
3404
+ # empty.
3405
+ sig { returns(T.nilable(String)) }
3406
+ attr_reader :source
3407
+
3408
+ sig { params(source: String).void }
3409
+ attr_writer :source
3410
+
3411
+ # The mount type. Available types:
3412
+ #
3413
+ # - `bind` a mount of a file or directory from the host into the container.
3414
+ # - `cluster` a Swarm cluster volume.
3415
+ # - `image` an OCI image.
3416
+ # - `npipe` a named pipe from the host into the container.
3417
+ # - `tmpfs` a `tmpfs`.
3418
+ # - `volume` a docker volume with the given `Name`.
3419
+ sig do
3420
+ returns(T.nilable(DockerEngine::Container::Mount::Type::TaggedSymbol))
3421
+ end
3422
+ attr_reader :type
3423
+
3424
+ sig do
3425
+ params(type: DockerEngine::Container::Mount::Type::OrSymbol).void
3426
+ end
3427
+ attr_writer :type
3428
+
3429
+ # MountPoint represents a mount point configuration inside the container. This is
3430
+ # used for reporting the mountpoints in use by a container.
3431
+ sig do
3432
+ params(
3433
+ destination: String,
3434
+ driver: String,
3435
+ mode: String,
3436
+ name: String,
3437
+ propagation: String,
3438
+ rw: T::Boolean,
3439
+ source: String,
3440
+ type: DockerEngine::Container::Mount::Type::OrSymbol
3441
+ ).returns(T.attached_class)
3442
+ end
3443
+ def self.new(
3444
+ # Destination is the path relative to the container root (`/`) where the `Source`
3445
+ # is mounted inside the container.
3446
+ destination: nil,
3447
+ # Driver is the volume driver used to create the volume (if it is a volume).
3448
+ driver: nil,
3449
+ # Mode is a comma separated list of options supplied by the user when creating the
3450
+ # bind/volume mount.
3451
+ #
3452
+ # The default is platform-specific (`"z"` on Linux, empty on Windows).
3453
+ mode: nil,
3454
+ # Name is the name reference to the underlying data defined by `Source` e.g., the
3455
+ # volume name.
3456
+ name: nil,
3457
+ # Propagation describes how mounts are propagated from the host into the mount
3458
+ # point, and vice-versa. Refer to the
3459
+ # [Linux kernel documentation](https://www.kernel.org/doc/Documentation/filesystems/sharedsubtree.txt)
3460
+ # for details. This field is not used on Windows.
3461
+ propagation: nil,
3462
+ # Whether the mount is mounted writable (read-write).
3463
+ rw: nil,
3464
+ # Source location of the mount.
3465
+ #
3466
+ # For volumes, this contains the storage location of the volume (within
3467
+ # `/var/lib/docker/volumes/`). For bind-mounts, and `npipe`, this contains the
3468
+ # source (host) part of the bind-mount. For `tmpfs` mount points, this field is
3469
+ # empty.
3470
+ source: nil,
3471
+ # The mount type. Available types:
3472
+ #
3473
+ # - `bind` a mount of a file or directory from the host into the container.
3474
+ # - `cluster` a Swarm cluster volume.
3475
+ # - `image` an OCI image.
3476
+ # - `npipe` a named pipe from the host into the container.
3477
+ # - `tmpfs` a `tmpfs`.
3478
+ # - `volume` a docker volume with the given `Name`.
3479
+ type: nil
3480
+ )
3481
+ end
3482
+
3483
+ sig do
3484
+ override.returns(
3485
+ {
3486
+ destination: String,
3487
+ driver: String,
3488
+ mode: String,
3489
+ name: String,
3490
+ propagation: String,
3491
+ rw: T::Boolean,
3492
+ source: String,
3493
+ type: DockerEngine::Container::Mount::Type::TaggedSymbol
3494
+ }
3495
+ )
3496
+ end
3497
+ def to_hash
3498
+ end
3499
+
3500
+ # The mount type. Available types:
3501
+ #
3502
+ # - `bind` a mount of a file or directory from the host into the container.
3503
+ # - `cluster` a Swarm cluster volume.
3504
+ # - `image` an OCI image.
3505
+ # - `npipe` a named pipe from the host into the container.
3506
+ # - `tmpfs` a `tmpfs`.
3507
+ # - `volume` a docker volume with the given `Name`.
3508
+ module Type
3509
+ extend DockerEngine::Internal::Type::Enum
3510
+
3511
+ TaggedSymbol =
3512
+ T.type_alias { T.all(Symbol, DockerEngine::Container::Mount::Type) }
3513
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
3514
+
3515
+ BIND =
3516
+ T.let(:bind, DockerEngine::Container::Mount::Type::TaggedSymbol)
3517
+ CLUSTER =
3518
+ T.let(:cluster, DockerEngine::Container::Mount::Type::TaggedSymbol)
3519
+ IMAGE =
3520
+ T.let(:image, DockerEngine::Container::Mount::Type::TaggedSymbol)
3521
+ NPIPE =
3522
+ T.let(:npipe, DockerEngine::Container::Mount::Type::TaggedSymbol)
3523
+ TMPFS =
3524
+ T.let(:tmpfs, DockerEngine::Container::Mount::Type::TaggedSymbol)
3525
+ VOLUME =
3526
+ T.let(:volume, DockerEngine::Container::Mount::Type::TaggedSymbol)
3527
+
3528
+ sig do
3529
+ override.returns(
3530
+ T::Array[DockerEngine::Container::Mount::Type::TaggedSymbol]
3531
+ )
3532
+ end
3533
+ def self.values
3534
+ end
3535
+ end
3536
+ end
3537
+
3538
+ class NetworkSettings < DockerEngine::Internal::Type::BaseModel
3539
+ OrHash =
3540
+ T.type_alias do
3541
+ T.any(
3542
+ DockerEngine::Container::NetworkSettings,
3543
+ DockerEngine::Internal::AnyHash
3544
+ )
3545
+ end
3546
+
3547
+ # Information about all networks that the container is connected to.
3548
+ sig do
3549
+ returns(
3550
+ T.nilable(
3551
+ T::Hash[Symbol, DockerEngine::Container::NetworkSettings::Network]
3552
+ )
3553
+ )
3554
+ end
3555
+ attr_reader :networks
3556
+
3557
+ sig do
3558
+ params(
3559
+ networks:
3560
+ T::Hash[
3561
+ Symbol,
3562
+ DockerEngine::Container::NetworkSettings::Network::OrHash
3563
+ ]
3564
+ ).void
3565
+ end
3566
+ attr_writer :networks
3567
+
3568
+ # PortMap describes the mapping of container ports to host ports, using the
3569
+ # container's port-number and protocol as key in the format `<port>/<protocol>`,
3570
+ # for example, `80/udp`.
3571
+ #
3572
+ # If a container's port is mapped for multiple protocols, separate entries are
3573
+ # added to the mapping table.
3574
+ sig do
3575
+ returns(
3576
+ T.nilable(
3577
+ T::Hash[
3578
+ Symbol,
3579
+ T::Array[DockerEngine::Container::NetworkSettings::Port]
3580
+ ]
3581
+ )
3582
+ )
3583
+ end
3584
+ attr_reader :ports
3585
+
3586
+ sig do
3587
+ params(
3588
+ ports:
3589
+ T::Hash[
3590
+ Symbol,
3591
+ T::Array[DockerEngine::Container::NetworkSettings::Port::OrHash]
3592
+ ]
3593
+ ).void
3594
+ end
3595
+ attr_writer :ports
3596
+
3597
+ # SandboxID uniquely represents a container's network stack.
3598
+ sig { returns(T.nilable(String)) }
3599
+ attr_reader :sandbox_id
3600
+
3601
+ sig { params(sandbox_id: String).void }
3602
+ attr_writer :sandbox_id
3603
+
3604
+ # SandboxKey is the full path of the netns handle
3605
+ sig { returns(T.nilable(String)) }
3606
+ attr_reader :sandbox_key
3607
+
3608
+ sig { params(sandbox_key: String).void }
3609
+ attr_writer :sandbox_key
3610
+
3611
+ # NetworkSettings exposes the network settings in the API
3612
+ sig do
3613
+ params(
3614
+ networks:
3615
+ T::Hash[
3616
+ Symbol,
3617
+ DockerEngine::Container::NetworkSettings::Network::OrHash
3618
+ ],
3619
+ ports:
3620
+ T::Hash[
3621
+ Symbol,
3622
+ T::Array[DockerEngine::Container::NetworkSettings::Port::OrHash]
3623
+ ],
3624
+ sandbox_id: String,
3625
+ sandbox_key: String
3626
+ ).returns(T.attached_class)
3627
+ end
3628
+ def self.new(
3629
+ # Information about all networks that the container is connected to.
3630
+ networks: nil,
3631
+ # PortMap describes the mapping of container ports to host ports, using the
3632
+ # container's port-number and protocol as key in the format `<port>/<protocol>`,
3633
+ # for example, `80/udp`.
3634
+ #
3635
+ # If a container's port is mapped for multiple protocols, separate entries are
3636
+ # added to the mapping table.
3637
+ ports: nil,
3638
+ # SandboxID uniquely represents a container's network stack.
3639
+ sandbox_id: nil,
3640
+ # SandboxKey is the full path of the netns handle
3641
+ sandbox_key: nil
3642
+ )
3643
+ end
3644
+
3645
+ sig do
3646
+ override.returns(
3647
+ {
3648
+ networks:
3649
+ T::Hash[
3650
+ Symbol,
3651
+ DockerEngine::Container::NetworkSettings::Network
3652
+ ],
3653
+ ports:
3654
+ T::Hash[
3655
+ Symbol,
3656
+ T::Array[DockerEngine::Container::NetworkSettings::Port]
3657
+ ],
3658
+ sandbox_id: String,
3659
+ sandbox_key: String
3660
+ }
3661
+ )
3662
+ end
3663
+ def to_hash
3664
+ end
3665
+
3666
+ class Network < DockerEngine::Internal::Type::BaseModel
3667
+ OrHash =
3668
+ T.type_alias do
3669
+ T.any(
3670
+ DockerEngine::Container::NetworkSettings::Network,
3671
+ DockerEngine::Internal::AnyHash
3672
+ )
3673
+ end
3674
+
3675
+ sig { returns(T.nilable(T::Array[String])) }
3676
+ attr_reader :aliases
3677
+
3678
+ sig { params(aliases: T::Array[String]).void }
3679
+ attr_writer :aliases
3680
+
3681
+ # List of all DNS names an endpoint has on a specific network. This list is based
3682
+ # on the container name, network aliases, container short ID, and hostname.
3683
+ #
3684
+ # These DNS names are non-fully qualified but can contain several dots. You can
3685
+ # get fully qualified DNS names by appending `.<network-name>`. For instance, if
3686
+ # container name is `my.ctr` and the network is named `testnet`, `DNSNames` will
3687
+ # contain `my.ctr` and the FQDN will be `my.ctr.testnet`.
3688
+ sig { returns(T.nilable(T::Array[String])) }
3689
+ attr_reader :dns_names
3690
+
3691
+ sig { params(dns_names: T::Array[String]).void }
3692
+ attr_writer :dns_names
3693
+
3694
+ # DriverOpts is a mapping of driver options and values. These options are passed
3695
+ # directly to the driver and are driver specific.
3696
+ sig { returns(T.nilable(T::Hash[Symbol, String])) }
3697
+ attr_accessor :driver_opts
3698
+
3699
+ # Unique ID for the service endpoint in a Sandbox.
3700
+ sig { returns(T.nilable(String)) }
3701
+ attr_reader :endpoint_id
3702
+
3703
+ sig { params(endpoint_id: String).void }
3704
+ attr_writer :endpoint_id
3705
+
3706
+ # Gateway address for this network.
3707
+ sig { returns(T.nilable(String)) }
3708
+ attr_reader :gateway
3709
+
3710
+ sig { params(gateway: String).void }
3711
+ attr_writer :gateway
3712
+
3713
+ # Global IPv6 address.
3714
+ sig { returns(T.nilable(String)) }
3715
+ attr_reader :global_i_pv6_address
3716
+
3717
+ sig { params(global_i_pv6_address: String).void }
3718
+ attr_writer :global_i_pv6_address
3719
+
3720
+ # Mask length of the global IPv6 address.
3721
+ sig { returns(T.nilable(Integer)) }
3722
+ attr_reader :global_i_pv6_prefix_len
3723
+
3724
+ sig { params(global_i_pv6_prefix_len: Integer).void }
3725
+ attr_writer :global_i_pv6_prefix_len
3726
+
3727
+ # This property determines which endpoint will provide the default gateway for a
3728
+ # container. The endpoint with the highest priority will be used. If multiple
3729
+ # endpoints have the same priority, endpoints are lexicographically sorted based
3730
+ # on their network name, and the one that sorts first is picked.
3731
+ sig { returns(T.nilable(Integer)) }
3732
+ attr_reader :gw_priority
3733
+
3734
+ sig { params(gw_priority: Integer).void }
3735
+ attr_writer :gw_priority
3736
+
3737
+ # IPv4 address.
3738
+ sig { returns(T.nilable(String)) }
3739
+ attr_reader :ip_address
3740
+
3741
+ sig { params(ip_address: String).void }
3742
+ attr_writer :ip_address
3743
+
3744
+ # EndpointIPAMConfig represents an endpoint's IPAM configuration.
3745
+ sig do
3746
+ returns(
3747
+ T.nilable(
3748
+ DockerEngine::Container::NetworkSettings::Network::IpamConfig
3749
+ )
3750
+ )
3751
+ end
3752
+ attr_reader :ipam_config
3753
+
3754
+ sig do
3755
+ params(
3756
+ ipam_config:
3757
+ T.nilable(
3758
+ DockerEngine::Container::NetworkSettings::Network::IpamConfig::OrHash
3759
+ )
3760
+ ).void
3761
+ end
3762
+ attr_writer :ipam_config
3763
+
3764
+ # Mask length of the IPv4 address.
3765
+ sig { returns(T.nilable(Integer)) }
3766
+ attr_reader :ip_prefix_len
3767
+
3768
+ sig { params(ip_prefix_len: Integer).void }
3769
+ attr_writer :ip_prefix_len
3770
+
3771
+ # IPv6 gateway address.
3772
+ sig { returns(T.nilable(String)) }
3773
+ attr_reader :i_pv6_gateway
3774
+
3775
+ sig { params(i_pv6_gateway: String).void }
3776
+ attr_writer :i_pv6_gateway
3777
+
3778
+ sig { returns(T.nilable(T::Array[String])) }
3779
+ attr_reader :links
3780
+
3781
+ sig { params(links: T::Array[String]).void }
3782
+ attr_writer :links
3783
+
3784
+ # MAC address for the endpoint on this network. The network driver might ignore
3785
+ # this parameter.
3786
+ sig { returns(T.nilable(String)) }
3787
+ attr_reader :mac_address
3788
+
3789
+ sig { params(mac_address: String).void }
3790
+ attr_writer :mac_address
3791
+
3792
+ # Unique ID of the network.
3793
+ sig { returns(T.nilable(String)) }
3794
+ attr_reader :network_id
3795
+
3796
+ sig { params(network_id: String).void }
3797
+ attr_writer :network_id
3798
+
3799
+ # Configuration for a network endpoint.
3800
+ sig do
3801
+ params(
3802
+ aliases: T::Array[String],
3803
+ dns_names: T::Array[String],
3804
+ driver_opts: T.nilable(T::Hash[Symbol, String]),
3805
+ endpoint_id: String,
3806
+ gateway: String,
3807
+ global_i_pv6_address: String,
3808
+ global_i_pv6_prefix_len: Integer,
3809
+ gw_priority: Integer,
3810
+ ip_address: String,
3811
+ ipam_config:
3812
+ T.nilable(
3813
+ DockerEngine::Container::NetworkSettings::Network::IpamConfig::OrHash
3814
+ ),
3815
+ ip_prefix_len: Integer,
3816
+ i_pv6_gateway: String,
3817
+ links: T::Array[String],
3818
+ mac_address: String,
3819
+ network_id: String
3820
+ ).returns(T.attached_class)
3821
+ end
3822
+ def self.new(
3823
+ aliases: nil,
3824
+ # List of all DNS names an endpoint has on a specific network. This list is based
3825
+ # on the container name, network aliases, container short ID, and hostname.
3826
+ #
3827
+ # These DNS names are non-fully qualified but can contain several dots. You can
3828
+ # get fully qualified DNS names by appending `.<network-name>`. For instance, if
3829
+ # container name is `my.ctr` and the network is named `testnet`, `DNSNames` will
3830
+ # contain `my.ctr` and the FQDN will be `my.ctr.testnet`.
3831
+ dns_names: nil,
3832
+ # DriverOpts is a mapping of driver options and values. These options are passed
3833
+ # directly to the driver and are driver specific.
3834
+ driver_opts: nil,
3835
+ # Unique ID for the service endpoint in a Sandbox.
3836
+ endpoint_id: nil,
3837
+ # Gateway address for this network.
3838
+ gateway: nil,
3839
+ # Global IPv6 address.
3840
+ global_i_pv6_address: nil,
3841
+ # Mask length of the global IPv6 address.
3842
+ global_i_pv6_prefix_len: nil,
3843
+ # This property determines which endpoint will provide the default gateway for a
3844
+ # container. The endpoint with the highest priority will be used. If multiple
3845
+ # endpoints have the same priority, endpoints are lexicographically sorted based
3846
+ # on their network name, and the one that sorts first is picked.
3847
+ gw_priority: nil,
3848
+ # IPv4 address.
3849
+ ip_address: nil,
3850
+ # EndpointIPAMConfig represents an endpoint's IPAM configuration.
3851
+ ipam_config: nil,
3852
+ # Mask length of the IPv4 address.
3853
+ ip_prefix_len: nil,
3854
+ # IPv6 gateway address.
3855
+ i_pv6_gateway: nil,
3856
+ links: nil,
3857
+ # MAC address for the endpoint on this network. The network driver might ignore
3858
+ # this parameter.
3859
+ mac_address: nil,
3860
+ # Unique ID of the network.
3861
+ network_id: nil
3862
+ )
3863
+ end
3864
+
3865
+ sig do
3866
+ override.returns(
3867
+ {
3868
+ aliases: T::Array[String],
3869
+ dns_names: T::Array[String],
3870
+ driver_opts: T.nilable(T::Hash[Symbol, String]),
3871
+ endpoint_id: String,
3872
+ gateway: String,
3873
+ global_i_pv6_address: String,
3874
+ global_i_pv6_prefix_len: Integer,
3875
+ gw_priority: Integer,
3876
+ ip_address: String,
3877
+ ipam_config:
3878
+ T.nilable(
3879
+ DockerEngine::Container::NetworkSettings::Network::IpamConfig
3880
+ ),
3881
+ ip_prefix_len: Integer,
3882
+ i_pv6_gateway: String,
3883
+ links: T::Array[String],
3884
+ mac_address: String,
3885
+ network_id: String
3886
+ }
3887
+ )
3888
+ end
3889
+ def to_hash
3890
+ end
3891
+
3892
+ class IpamConfig < DockerEngine::Internal::Type::BaseModel
3893
+ OrHash =
3894
+ T.type_alias do
3895
+ T.any(
3896
+ DockerEngine::Container::NetworkSettings::Network::IpamConfig,
3897
+ DockerEngine::Internal::AnyHash
3898
+ )
3899
+ end
3900
+
3901
+ sig { returns(T.nilable(String)) }
3902
+ attr_reader :i_pv4_address
3903
+
3904
+ sig { params(i_pv4_address: String).void }
3905
+ attr_writer :i_pv4_address
3906
+
3907
+ sig { returns(T.nilable(String)) }
3908
+ attr_reader :i_pv6_address
3909
+
3910
+ sig { params(i_pv6_address: String).void }
3911
+ attr_writer :i_pv6_address
3912
+
3913
+ sig { returns(T.nilable(T::Array[String])) }
3914
+ attr_reader :link_local_ips
3915
+
3916
+ sig { params(link_local_ips: T::Array[String]).void }
3917
+ attr_writer :link_local_ips
3918
+
3919
+ # EndpointIPAMConfig represents an endpoint's IPAM configuration.
3920
+ sig do
3921
+ params(
3922
+ i_pv4_address: String,
3923
+ i_pv6_address: String,
3924
+ link_local_ips: T::Array[String]
3925
+ ).returns(T.attached_class)
3926
+ end
3927
+ def self.new(
3928
+ i_pv4_address: nil,
3929
+ i_pv6_address: nil,
3930
+ link_local_ips: nil
3931
+ )
3932
+ end
3933
+
3934
+ sig do
3935
+ override.returns(
3936
+ {
3937
+ i_pv4_address: String,
3938
+ i_pv6_address: String,
3939
+ link_local_ips: T::Array[String]
3940
+ }
3941
+ )
3942
+ end
3943
+ def to_hash
3944
+ end
3945
+ end
3946
+ end
3947
+
3948
+ class Port < DockerEngine::Internal::Type::BaseModel
3949
+ OrHash =
3950
+ T.type_alias do
3951
+ T.any(
3952
+ DockerEngine::Container::NetworkSettings::Port,
3953
+ DockerEngine::Internal::AnyHash
3954
+ )
3955
+ end
3956
+
3957
+ # Host IP address that the container's port is mapped to.
3958
+ sig { returns(T.nilable(String)) }
3959
+ attr_reader :host_ip
3960
+
3961
+ sig { params(host_ip: String).void }
3962
+ attr_writer :host_ip
3963
+
3964
+ # Host port number that the container's port is mapped to.
3965
+ sig { returns(T.nilable(String)) }
3966
+ attr_reader :host_port
3967
+
3968
+ sig { params(host_port: String).void }
3969
+ attr_writer :host_port
3970
+
3971
+ # PortBinding represents a binding between a host IP address and a host port.
3972
+ sig do
3973
+ params(host_ip: String, host_port: String).returns(T.attached_class)
3974
+ end
3975
+ def self.new(
3976
+ # Host IP address that the container's port is mapped to.
3977
+ host_ip: nil,
3978
+ # Host port number that the container's port is mapped to.
3979
+ host_port: nil
3980
+ )
3981
+ end
3982
+
3983
+ sig { override.returns({ host_ip: String, host_port: String }) }
3984
+ def to_hash
3985
+ end
3986
+ end
3987
+ end
3988
+
3989
+ class State < DockerEngine::Internal::Type::BaseModel
3990
+ OrHash =
3991
+ T.type_alias do
3992
+ T.any(
3993
+ DockerEngine::Container::State,
3994
+ DockerEngine::Internal::AnyHash
3995
+ )
3996
+ end
3997
+
3998
+ sig { returns(T.nilable(T::Boolean)) }
3999
+ attr_reader :dead
4000
+
4001
+ sig { params(dead: T::Boolean).void }
4002
+ attr_writer :dead
4003
+
4004
+ sig { returns(T.nilable(String)) }
4005
+ attr_reader :error
4006
+
4007
+ sig { params(error: String).void }
4008
+ attr_writer :error
4009
+
4010
+ # The last exit code of this container
4011
+ sig { returns(T.nilable(Integer)) }
4012
+ attr_reader :exit_code
4013
+
4014
+ sig { params(exit_code: Integer).void }
4015
+ attr_writer :exit_code
4016
+
4017
+ # The time when this container last exited.
4018
+ sig { returns(T.nilable(String)) }
4019
+ attr_reader :finished_at
4020
+
4021
+ sig { params(finished_at: String).void }
4022
+ attr_writer :finished_at
4023
+
4024
+ # Health stores information about the container's healthcheck results.
4025
+ sig { returns(T.nilable(DockerEngine::Container::State::Health)) }
4026
+ attr_reader :health
4027
+
4028
+ sig do
4029
+ params(
4030
+ health: T.nilable(DockerEngine::Container::State::Health::OrHash)
4031
+ ).void
4032
+ end
4033
+ attr_writer :health
4034
+
4035
+ # Whether a process within this container has been killed because it ran out of
4036
+ # memory since the container was last started.
4037
+ sig { returns(T.nilable(T::Boolean)) }
4038
+ attr_reader :oom_killed
4039
+
4040
+ sig { params(oom_killed: T::Boolean).void }
4041
+ attr_writer :oom_killed
4042
+
4043
+ # Whether this container is paused.
4044
+ sig { returns(T.nilable(T::Boolean)) }
4045
+ attr_reader :paused
4046
+
4047
+ sig { params(paused: T::Boolean).void }
4048
+ attr_writer :paused
4049
+
4050
+ # The process ID of this container
4051
+ sig { returns(T.nilable(Integer)) }
4052
+ attr_reader :pid
4053
+
4054
+ sig { params(pid: Integer).void }
4055
+ attr_writer :pid
4056
+
4057
+ # Whether this container is restarting.
4058
+ sig { returns(T.nilable(T::Boolean)) }
4059
+ attr_reader :restarting
4060
+
4061
+ sig { params(restarting: T::Boolean).void }
4062
+ attr_writer :restarting
4063
+
4064
+ # Whether this container is running.
4065
+ #
4066
+ # Note that a running container can be _paused_. The `Running` and `Paused`
4067
+ # booleans are not mutually exclusive:
4068
+ #
4069
+ # When pausing a container (on Linux), the freezer cgroup is used to suspend all
4070
+ # processes in the container. Freezing the process requires the process to be
4071
+ # running. As a result, paused containers are both `Running` _and_ `Paused`.
4072
+ #
4073
+ # Use the `Status` field instead to determine if a container's state is "running".
4074
+ sig { returns(T.nilable(T::Boolean)) }
4075
+ attr_reader :running
4076
+
4077
+ sig { params(running: T::Boolean).void }
4078
+ attr_writer :running
4079
+
4080
+ # The time when this container was last started.
4081
+ sig { returns(T.nilable(String)) }
4082
+ attr_reader :started_at
4083
+
4084
+ sig { params(started_at: String).void }
4085
+ attr_writer :started_at
4086
+
4087
+ # String representation of the container state. Can be one of "created",
4088
+ # "running", "paused", "restarting", "removing", "exited", or "dead".
4089
+ sig do
4090
+ returns(
4091
+ T.nilable(DockerEngine::Container::State::Status::TaggedSymbol)
4092
+ )
4093
+ end
4094
+ attr_reader :status
4095
+
4096
+ sig do
4097
+ params(status: DockerEngine::Container::State::Status::OrSymbol).void
4098
+ end
4099
+ attr_writer :status
4100
+
4101
+ # ContainerState stores container's running state. It's part of ContainerJSONBase
4102
+ # and will be returned by the "inspect" command.
4103
+ sig do
4104
+ params(
4105
+ dead: T::Boolean,
4106
+ error: String,
4107
+ exit_code: Integer,
4108
+ finished_at: String,
4109
+ health: T.nilable(DockerEngine::Container::State::Health::OrHash),
4110
+ oom_killed: T::Boolean,
4111
+ paused: T::Boolean,
4112
+ pid: Integer,
4113
+ restarting: T::Boolean,
4114
+ running: T::Boolean,
4115
+ started_at: String,
4116
+ status: DockerEngine::Container::State::Status::OrSymbol
4117
+ ).returns(T.attached_class)
4118
+ end
4119
+ def self.new(
4120
+ dead: nil,
4121
+ error: nil,
4122
+ # The last exit code of this container
4123
+ exit_code: nil,
4124
+ # The time when this container last exited.
4125
+ finished_at: nil,
4126
+ # Health stores information about the container's healthcheck results.
4127
+ health: nil,
4128
+ # Whether a process within this container has been killed because it ran out of
4129
+ # memory since the container was last started.
4130
+ oom_killed: nil,
4131
+ # Whether this container is paused.
4132
+ paused: nil,
4133
+ # The process ID of this container
4134
+ pid: nil,
4135
+ # Whether this container is restarting.
4136
+ restarting: nil,
4137
+ # Whether this container is running.
4138
+ #
4139
+ # Note that a running container can be _paused_. The `Running` and `Paused`
4140
+ # booleans are not mutually exclusive:
4141
+ #
4142
+ # When pausing a container (on Linux), the freezer cgroup is used to suspend all
4143
+ # processes in the container. Freezing the process requires the process to be
4144
+ # running. As a result, paused containers are both `Running` _and_ `Paused`.
4145
+ #
4146
+ # Use the `Status` field instead to determine if a container's state is "running".
4147
+ running: nil,
4148
+ # The time when this container was last started.
4149
+ started_at: nil,
4150
+ # String representation of the container state. Can be one of "created",
4151
+ # "running", "paused", "restarting", "removing", "exited", or "dead".
4152
+ status: nil
4153
+ )
4154
+ end
4155
+
4156
+ sig do
4157
+ override.returns(
4158
+ {
4159
+ dead: T::Boolean,
4160
+ error: String,
4161
+ exit_code: Integer,
4162
+ finished_at: String,
4163
+ health: T.nilable(DockerEngine::Container::State::Health),
4164
+ oom_killed: T::Boolean,
4165
+ paused: T::Boolean,
4166
+ pid: Integer,
4167
+ restarting: T::Boolean,
4168
+ running: T::Boolean,
4169
+ started_at: String,
4170
+ status: DockerEngine::Container::State::Status::TaggedSymbol
4171
+ }
4172
+ )
4173
+ end
4174
+ def to_hash
4175
+ end
4176
+
4177
+ class Health < DockerEngine::Internal::Type::BaseModel
4178
+ OrHash =
4179
+ T.type_alias do
4180
+ T.any(
4181
+ DockerEngine::Container::State::Health,
4182
+ DockerEngine::Internal::AnyHash
4183
+ )
4184
+ end
4185
+
4186
+ # FailingStreak is the number of consecutive failures
4187
+ sig { returns(T.nilable(Integer)) }
4188
+ attr_reader :failing_streak
4189
+
4190
+ sig { params(failing_streak: Integer).void }
4191
+ attr_writer :failing_streak
4192
+
4193
+ # Log contains the last few results (oldest first)
4194
+ sig do
4195
+ returns(
4196
+ T.nilable(
4197
+ T::Array[T.nilable(DockerEngine::Container::State::Health::Log)]
4198
+ )
4199
+ )
4200
+ end
4201
+ attr_reader :log
4202
+
4203
+ sig do
4204
+ params(
4205
+ log:
4206
+ T::Array[
4207
+ T.nilable(DockerEngine::Container::State::Health::Log::OrHash)
4208
+ ]
4209
+ ).void
4210
+ end
4211
+ attr_writer :log
4212
+
4213
+ # Status is one of `none`, `starting`, `healthy` or `unhealthy`
4214
+ #
4215
+ # - "none" Indicates there is no healthcheck
4216
+ # - "starting" Starting indicates that the container is not yet ready
4217
+ # - "healthy" Healthy indicates that the container is running correctly
4218
+ # - "unhealthy" Unhealthy indicates that the container has a problem
4219
+ sig do
4220
+ returns(
4221
+ T.nilable(
4222
+ DockerEngine::Container::State::Health::Status::TaggedSymbol
4223
+ )
4224
+ )
4225
+ end
4226
+ attr_reader :status
4227
+
4228
+ sig do
4229
+ params(
4230
+ status: DockerEngine::Container::State::Health::Status::OrSymbol
4231
+ ).void
4232
+ end
4233
+ attr_writer :status
4234
+
4235
+ # Health stores information about the container's healthcheck results.
4236
+ sig do
4237
+ params(
4238
+ failing_streak: Integer,
4239
+ log:
4240
+ T::Array[
4241
+ T.nilable(DockerEngine::Container::State::Health::Log::OrHash)
4242
+ ],
4243
+ status: DockerEngine::Container::State::Health::Status::OrSymbol
4244
+ ).returns(T.attached_class)
4245
+ end
4246
+ def self.new(
4247
+ # FailingStreak is the number of consecutive failures
4248
+ failing_streak: nil,
4249
+ # Log contains the last few results (oldest first)
4250
+ log: nil,
4251
+ # Status is one of `none`, `starting`, `healthy` or `unhealthy`
4252
+ #
4253
+ # - "none" Indicates there is no healthcheck
4254
+ # - "starting" Starting indicates that the container is not yet ready
4255
+ # - "healthy" Healthy indicates that the container is running correctly
4256
+ # - "unhealthy" Unhealthy indicates that the container has a problem
4257
+ status: nil
4258
+ )
4259
+ end
4260
+
4261
+ sig do
4262
+ override.returns(
4263
+ {
4264
+ failing_streak: Integer,
4265
+ log:
4266
+ T::Array[
4267
+ T.nilable(DockerEngine::Container::State::Health::Log)
4268
+ ],
4269
+ status:
4270
+ DockerEngine::Container::State::Health::Status::TaggedSymbol
4271
+ }
4272
+ )
4273
+ end
4274
+ def to_hash
4275
+ end
4276
+
4277
+ class Log < DockerEngine::Internal::Type::BaseModel
4278
+ OrHash =
4279
+ T.type_alias do
4280
+ T.any(
4281
+ DockerEngine::Container::State::Health::Log,
4282
+ DockerEngine::Internal::AnyHash
4283
+ )
4284
+ end
4285
+
4286
+ # Date and time at which this check ended in
4287
+ # [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds.
4288
+ sig { returns(T.nilable(String)) }
4289
+ attr_reader :end_
4290
+
4291
+ sig { params(end_: String).void }
4292
+ attr_writer :end_
4293
+
4294
+ # ExitCode meanings:
4295
+ #
4296
+ # - `0` healthy
4297
+ # - `1` unhealthy
4298
+ # - `2` reserved (considered unhealthy)
4299
+ # - other values: error running probe
4300
+ sig { returns(T.nilable(Integer)) }
4301
+ attr_reader :exit_code
4302
+
4303
+ sig { params(exit_code: Integer).void }
4304
+ attr_writer :exit_code
4305
+
4306
+ # Output from last check
4307
+ sig { returns(T.nilable(String)) }
4308
+ attr_reader :output
4309
+
4310
+ sig { params(output: String).void }
4311
+ attr_writer :output
4312
+
4313
+ # Date and time at which this check started in
4314
+ # [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds.
4315
+ sig { returns(T.nilable(Time)) }
4316
+ attr_reader :start
4317
+
4318
+ sig { params(start: Time).void }
4319
+ attr_writer :start
4320
+
4321
+ # HealthcheckResult stores information about a single run of a healthcheck probe
4322
+ sig do
4323
+ params(
4324
+ end_: String,
4325
+ exit_code: Integer,
4326
+ output: String,
4327
+ start: Time
4328
+ ).returns(T.attached_class)
4329
+ end
4330
+ def self.new(
4331
+ # Date and time at which this check ended in
4332
+ # [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds.
4333
+ end_: nil,
4334
+ # ExitCode meanings:
4335
+ #
4336
+ # - `0` healthy
4337
+ # - `1` unhealthy
4338
+ # - `2` reserved (considered unhealthy)
4339
+ # - other values: error running probe
4340
+ exit_code: nil,
4341
+ # Output from last check
4342
+ output: nil,
4343
+ # Date and time at which this check started in
4344
+ # [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds.
4345
+ start: nil
4346
+ )
4347
+ end
4348
+
4349
+ sig do
4350
+ override.returns(
4351
+ {
4352
+ end_: String,
4353
+ exit_code: Integer,
4354
+ output: String,
4355
+ start: Time
4356
+ }
4357
+ )
4358
+ end
4359
+ def to_hash
4360
+ end
4361
+ end
4362
+
4363
+ # Status is one of `none`, `starting`, `healthy` or `unhealthy`
4364
+ #
4365
+ # - "none" Indicates there is no healthcheck
4366
+ # - "starting" Starting indicates that the container is not yet ready
4367
+ # - "healthy" Healthy indicates that the container is running correctly
4368
+ # - "unhealthy" Unhealthy indicates that the container has a problem
4369
+ module Status
4370
+ extend DockerEngine::Internal::Type::Enum
4371
+
4372
+ TaggedSymbol =
4373
+ T.type_alias do
4374
+ T.all(Symbol, DockerEngine::Container::State::Health::Status)
4375
+ end
4376
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
4377
+
4378
+ NONE =
4379
+ T.let(
4380
+ :none,
4381
+ DockerEngine::Container::State::Health::Status::TaggedSymbol
4382
+ )
4383
+ STARTING =
4384
+ T.let(
4385
+ :starting,
4386
+ DockerEngine::Container::State::Health::Status::TaggedSymbol
4387
+ )
4388
+ HEALTHY =
4389
+ T.let(
4390
+ :healthy,
4391
+ DockerEngine::Container::State::Health::Status::TaggedSymbol
4392
+ )
4393
+ UNHEALTHY =
4394
+ T.let(
4395
+ :unhealthy,
4396
+ DockerEngine::Container::State::Health::Status::TaggedSymbol
4397
+ )
4398
+
4399
+ sig do
4400
+ override.returns(
4401
+ T::Array[
4402
+ DockerEngine::Container::State::Health::Status::TaggedSymbol
4403
+ ]
4404
+ )
4405
+ end
4406
+ def self.values
4407
+ end
4408
+ end
4409
+ end
4410
+
4411
+ # String representation of the container state. Can be one of "created",
4412
+ # "running", "paused", "restarting", "removing", "exited", or "dead".
4413
+ module Status
4414
+ extend DockerEngine::Internal::Type::Enum
4415
+
4416
+ TaggedSymbol =
4417
+ T.type_alias do
4418
+ T.all(Symbol, DockerEngine::Container::State::Status)
4419
+ end
4420
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
4421
+
4422
+ CREATED =
4423
+ T.let(
4424
+ :created,
4425
+ DockerEngine::Container::State::Status::TaggedSymbol
4426
+ )
4427
+ RUNNING =
4428
+ T.let(
4429
+ :running,
4430
+ DockerEngine::Container::State::Status::TaggedSymbol
4431
+ )
4432
+ PAUSED =
4433
+ T.let(:paused, DockerEngine::Container::State::Status::TaggedSymbol)
4434
+ RESTARTING =
4435
+ T.let(
4436
+ :restarting,
4437
+ DockerEngine::Container::State::Status::TaggedSymbol
4438
+ )
4439
+ REMOVING =
4440
+ T.let(
4441
+ :removing,
4442
+ DockerEngine::Container::State::Status::TaggedSymbol
4443
+ )
4444
+ EXITED =
4445
+ T.let(:exited, DockerEngine::Container::State::Status::TaggedSymbol)
4446
+ DEAD =
4447
+ T.let(:dead, DockerEngine::Container::State::Status::TaggedSymbol)
4448
+
4449
+ sig do
4450
+ override.returns(
4451
+ T::Array[DockerEngine::Container::State::Status::TaggedSymbol]
4452
+ )
4453
+ end
4454
+ def self.values
4455
+ end
4456
+ end
4457
+ end
4458
+
4459
+ class Storage < DockerEngine::Internal::Type::BaseModel
4460
+ OrHash =
4461
+ T.type_alias do
4462
+ T.any(
4463
+ DockerEngine::Container::Storage,
4464
+ DockerEngine::Internal::AnyHash
4465
+ )
4466
+ end
4467
+
4468
+ # Information about the storage used for the container's root filesystem.
4469
+ sig { returns(T.nilable(DockerEngine::Container::Storage::RootFs)) }
4470
+ attr_reader :root_fs
4471
+
4472
+ sig do
4473
+ params(root_fs: DockerEngine::Container::Storage::RootFs::OrHash).void
4474
+ end
4475
+ attr_writer :root_fs
4476
+
4477
+ # Information about the storage used by the container.
4478
+ sig do
4479
+ params(
4480
+ root_fs: DockerEngine::Container::Storage::RootFs::OrHash
4481
+ ).returns(T.attached_class)
4482
+ end
4483
+ def self.new(
4484
+ # Information about the storage used for the container's root filesystem.
4485
+ root_fs: nil
4486
+ )
4487
+ end
4488
+
4489
+ sig do
4490
+ override.returns(
4491
+ { root_fs: DockerEngine::Container::Storage::RootFs }
4492
+ )
4493
+ end
4494
+ def to_hash
4495
+ end
4496
+
4497
+ class RootFs < DockerEngine::Internal::Type::BaseModel
4498
+ OrHash =
4499
+ T.type_alias do
4500
+ T.any(
4501
+ DockerEngine::Container::Storage::RootFs,
4502
+ DockerEngine::Internal::AnyHash
4503
+ )
4504
+ end
4505
+
4506
+ # Information about a snapshot backend of the container's root filesystem.
4507
+ sig do
4508
+ returns(
4509
+ T.nilable(DockerEngine::Container::Storage::RootFs::Snapshot)
4510
+ )
4511
+ end
4512
+ attr_reader :snapshot
4513
+
4514
+ sig do
4515
+ params(
4516
+ snapshot:
4517
+ DockerEngine::Container::Storage::RootFs::Snapshot::OrHash
4518
+ ).void
4519
+ end
4520
+ attr_writer :snapshot
4521
+
4522
+ # Information about the storage used for the container's root filesystem.
4523
+ sig do
4524
+ params(
4525
+ snapshot:
4526
+ DockerEngine::Container::Storage::RootFs::Snapshot::OrHash
4527
+ ).returns(T.attached_class)
4528
+ end
4529
+ def self.new(
4530
+ # Information about a snapshot backend of the container's root filesystem.
4531
+ snapshot: nil
4532
+ )
4533
+ end
4534
+
4535
+ sig do
4536
+ override.returns(
4537
+ { snapshot: DockerEngine::Container::Storage::RootFs::Snapshot }
4538
+ )
4539
+ end
4540
+ def to_hash
4541
+ end
4542
+
4543
+ class Snapshot < DockerEngine::Internal::Type::BaseModel
4544
+ OrHash =
4545
+ T.type_alias do
4546
+ T.any(
4547
+ DockerEngine::Container::Storage::RootFs::Snapshot,
4548
+ DockerEngine::Internal::AnyHash
4549
+ )
4550
+ end
4551
+
4552
+ # Name of the snapshotter.
4553
+ sig { returns(T.nilable(String)) }
4554
+ attr_reader :name
4555
+
4556
+ sig { params(name: String).void }
4557
+ attr_writer :name
4558
+
4559
+ # Information about a snapshot backend of the container's root filesystem.
4560
+ sig { params(name: String).returns(T.attached_class) }
4561
+ def self.new(
4562
+ # Name of the snapshotter.
4563
+ name: nil
4564
+ )
4565
+ end
4566
+
4567
+ sig { override.returns({ name: String }) }
4568
+ def to_hash
4569
+ end
4570
+ end
4571
+ end
4572
+ end
4573
+ end
4574
+ end
4575
+ end