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 +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +16 -0
- data/lib/indocker/docker_run_args.rb +18 -0
- data/lib/indocker/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ecbac476e55b6387024d49a977cd056cf5b16ee54fd74b20951dfe969c16f983
|
|
4
|
+
data.tar.gz: b39294c0f4d12bec751b63008f144d0d5a7530bdecc70114f2b9d2e95bde3815
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c0b7780d0c6e133e6baa48a9d4fa69eed07ddfc35a9d4eaeaa723e508b85f7a2eab500cc05bd81de5fa681926cde24ae39a97a6ef7a140d544a297e9e9d13d95
|
|
7
|
+
data.tar.gz: 7702d93e7f4a19c8128e42181c0e292e37d82518891166789d9e81bc39c64c8537d027310234fe68bd5297cc36781db68c86dd2925509a55cdb2288f8bc092e4
|
data/Gemfile.lock
CHANGED
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}")
|
data/lib/indocker/version.rb
CHANGED
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.
|
|
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
|
|
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: []
|