Class: Docker::API::Exec
Overview
This class represents the Docker API exec related endpoints.
Instance Method Summary collapse
-
#create(name, body = {}) ⇒ Object
Run a command inside a running container.
-
#details(name) ⇒ Object
Return low-level information about an exec instance.
-
#resize(name, params = {}) ⇒ Object
Resize the TTY session used by an exec instance.
-
#start(name, body = {}, &block) ⇒ Object
Start a previously set up exec instance.
Methods inherited from Base
Constructor Details
This class inherits a constructor from Docker::API::Base
Instance Method Details
#create(name, body = {}) ⇒ Object
Run a command inside a running container.
Docker API: POST /containers/id/exec
14 15 16 |
# File 'lib/docker/api/exec.rb', line 14 def create name, body = {} @connection.request(method: :post, path: "/containers/#{name}/exec", headers: {"Content-Type": "application/json"}, body: body.to_json ) end |
#details(name) ⇒ Object
Return low-level information about an exec instance.
Docker API: GET /exec/id/json
51 52 53 |
# File 'lib/docker/api/exec.rb', line 51 def details name @connection.get("/exec/#{name}/json") end |
#resize(name, params = {}) ⇒ Object
Resize the TTY session used by an exec instance.
Docker API: POST /exec/id/resize
40 41 42 |
# File 'lib/docker/api/exec.rb', line 40 def resize name, params = {} @connection.post(build_path("/exec/#{name}/resize", params)) end |
#start(name, body = {}, &block) ⇒ Object
Start a previously set up exec instance.
Docker API: POST /exec/id/start
27 28 29 30 |
# File 'lib/docker/api/exec.rb', line 27 def start name, body = {}, &block @connection.request(method: :post, path: "/exec/#{name}/start", headers: {"Content-Type": "application/json"}, body: body.to_json, response_block: block_given? ? block : default_streamer ) end |