Class: Jive::Docker
- Inherits:
-
Object
- Object
- Jive::Docker
- Defined in:
- lib/jive/docker.rb
Instance Attribute Summary collapse
-
#shell ⇒ Object
readonly
Returns the value of attribute shell.
Instance Method Summary collapse
- #build(path) ⇒ Object
-
#initialize(shell = ::Jive.shell) ⇒ Docker
constructor
A new instance of Docker.
- #launch(path) ⇒ Object
- #size(path) ⇒ Object
Constructor Details
Instance Attribute Details
#shell ⇒ Object (readonly)
Returns the value of attribute shell.
5 6 7 |
# File 'lib/jive/docker.rb', line 5 def shell @shell end |
Instance Method Details
#build(path) ⇒ Object
11 12 13 14 15 16 17 18 19 |
# File 'lib/jive/docker.rb', line 11 def build(path) shell.execute([ "docker", "build", "--network=host", "-t", image_tag_for(path), "." ], env: { "DOCKER_BUILDKIT" => "1" }) end |
#launch(path) ⇒ Object
21 22 23 24 25 26 27 28 29 30 |
# File 'lib/jive/docker.rb', line 21 def launch(path) shell.execute([ "docker", "run", "--network=host", '--entrypoint=""', "-it", image_tag_for(path), "/bin/bash -l" ]) end |
#size(path) ⇒ Object
32 33 34 35 36 37 |
# File 'lib/jive/docker.rb', line 32 def size(path) shell.execute([ :docker, "image", "inspect", '--format="{{.Size}}"', image_tag_for(path) ]) end |