indocker 0.6.3 → 0.6.4

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 780f10ec65fb1d00426f0ab9ca95edc5098db54b3a42e70e0d018cdb772b0f6a
4
- data.tar.gz: 691da7b4d42efc31869b579302725c190e312d2c99c6b47e68b426551f4fca7e
3
+ metadata.gz: ecbac476e55b6387024d49a977cd056cf5b16ee54fd74b20951dfe969c16f983
4
+ data.tar.gz: b39294c0f4d12bec751b63008f144d0d5a7530bdecc70114f2b9d2e95bde3815
5
5
  SHA512:
6
- metadata.gz: 2af5782708e1b19331862119b8af2464d6f442fcce49bc79c314e7f4ebb85b01c4d67e1ac29751c80efcc30055f474e8b2bd158184580641235bb0cccf64489e
7
- data.tar.gz: e298f703e1d205c2d06e177823f7314059c24d3aff726f0c79e687c47edc1a043ea2bbe434ad91baff3e1b70adb3eea6dbc6b729789306f26e66caf3fc0aa9df
6
+ metadata.gz: c0b7780d0c6e133e6baa48a9d4fa69eed07ddfc35a9d4eaeaa723e508b85f7a2eab500cc05bd81de5fa681926cde24ae39a97a6ef7a140d544a297e9e9d13d95
7
+ data.tar.gz: 7702d93e7f4a19c8128e42181c0e292e37d82518891166789d9e81bc39c64c8537d027310234fe68bd5297cc36781db68c86dd2925509a55cdb2288f8bc092e4
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- indocker (0.6.2)
4
+ indocker (0.6.4)
5
5
  net-ssh
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -26,6 +26,22 @@ cd example
26
26
  indocker/bin/deploy -C external -c ruby -d
27
27
  ```
28
28
 
29
+ ## Container start options
30
+
31
+ Besides the named options (`restart`, `env_files`, `ports`, `add_hosts`, `nets`, `health`, ...),
32
+ `run_args` passes any other `docker run` flag as is:
33
+
34
+ ```ruby
35
+ Indocker
36
+ .define_container(:worker)
37
+ .start(run_args: ["--cpus=16", "--cpu-shares=256", "--memory=8g"])
38
+ ```
39
+
40
+ The same key works in a configuration's `enabled_containers` (`start: { run_args: [...] }`).
41
+ Each element is one flag starting with `-`. The run command is a bash script, so quote a value
42
+ with spaces yourself. The flags go last, so a repeated flag wins; changing them recreates the
43
+ container on the next deploy.
44
+
29
45
  ## License
30
46
 
31
47
  The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
@@ -173,6 +173,24 @@ class Indocker::DockerRunArgs
173
173
  end
174
174
  end
175
175
 
176
+ # Any docker run flag the options above don't cover (--cpus, --cpu-shares,
177
+ # --memory, --ulimit, --device, ...): each element is one flag, passed to
178
+ # docker run as is, after everything else, so a repeated flag wins.
179
+ # start: { run_args: ["--cpus=16", "--cpu-shares=256"] }
180
+ # The run command is written into a bash script: quote a value with spaces
181
+ # yourself. Changing run_args changes the run command, so the container is
182
+ # recreated on the next deploy.
183
+ run_args = container.get_start_option(:run_args) || []
184
+
185
+ if !run_args.is_a?(Array) || !run_args.all? { |arg| arg.is_a?(String) && arg.start_with?("-") }
186
+ raise ArgumentError.new(
187
+ "run_args for container :#{container.name} should be an Array of docker run flags, " \
188
+ "each a String starting with '-' (e.g. \"--cpus=16\"), got #{run_args.inspect}"
189
+ )
190
+ end
191
+
192
+ args.concat(run_args)
193
+
176
194
  container.volumes.each do |volume|
177
195
  if volume.is_a?(Indocker::Volumes::Local)
178
196
  args.push("-v #{volume.local_path}:#{volume.path}")
@@ -1,3 +1,3 @@
1
1
  module Indocker
2
- VERSION = "0.6.3"
2
+ VERSION = "0.6.4"
3
3
  end
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: indocker
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.3
4
+ version: 0.6.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ruslan Gatiyatov
8
8
  - Iskander Khaziev
9
- autorequire:
9
+ autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2026-08-18 00:00:00.000000000 Z
12
+ date: 2026-11-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: net-ssh
@@ -206,7 +206,7 @@ homepage: https://github.com/ArtStation/indocker
206
206
  licenses:
207
207
  - MIT
208
208
  metadata: {}
209
- post_install_message:
209
+ post_install_message:
210
210
  rdoc_options: []
211
211
  require_paths:
212
212
  - lib
@@ -222,7 +222,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
222
222
  version: '0'
223
223
  requirements: []
224
224
  rubygems_version: 3.4.1
225
- signing_key:
225
+ signing_key:
226
226
  specification_version: 4
227
227
  summary: Docker Containers Deployment
228
228
  test_files: []