docker-api 2.2.0 → 2.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/lib/docker/base.rb +2 -0
- data/lib/docker/connection.rb +2 -0
- data/lib/docker/container.rb +2 -0
- data/lib/docker/error.rb +2 -0
- data/lib/docker/event.rb +2 -0
- data/lib/docker/exec.rb +2 -0
- data/lib/docker/image.rb +10 -8
- data/lib/docker/messages.rb +2 -0
- data/lib/docker/messages_stack.rb +2 -0
- data/lib/docker/network.rb +2 -0
- data/lib/docker/rake_task.rb +2 -0
- data/lib/docker/util.rb +2 -0
- data/lib/docker/version.rb +3 -1
- data/lib/docker/volume.rb +2 -0
- data/lib/docker-api.rb +2 -0
- data/lib/docker.rb +2 -0
- data/lib/excon/middlewares/hijack.rb +6 -2
- metadata +9 -23
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c8c844030bda8d245234ddd5d977ad5202b9a2f0a2e34175579790d79e6f584b
|
4
|
+
data.tar.gz: 5b793f7689d091a8a765853511e4f0f8f495338250cdec62bce30fc7a83d5117
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d5ce08a8dfbe1e5377ceb62d8186e4973ca6f7fa8d166bd9177f8f4a3338dc2dfeb3d735d3c54e31b15373f4124cc87d509d369a34e0f1598291105a4593947f
|
7
|
+
data.tar.gz: d27a38af366bbb20febcc3699238a56f5c52d24394780c25d3caf72bc6f9314fb8bae6dd9c7f53cd5ff30558f5bbc353d22fc9f236913a2d8786488c9a702aea
|
data/README.md
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
docker-api
|
2
2
|
==========
|
3
|
-
[![Gem Version](https://badge.fury.io/rb/docker-api.svg)](https://badge.fury.io/rb/docker-api) [![
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/docker-api.svg)](https://badge.fury.io/rb/docker-api) [![Code Climate](https://codeclimate.com/github/upserve/docker-api.svg)](https://codeclimate.com/github/upserve/docker-api)
|
4
4
|
|
5
5
|
This gem provides an object-oriented interface to the [Docker Engine API](https://docs.docker.com/develop/sdk/). Every method listed there is implemented. At the time of this writing, docker-api is meant to interface with Docker version 1.4.*
|
6
6
|
|
7
|
-
If you're interested in using Docker to package your apps, we recommend the [dockly](https://github.com/
|
7
|
+
If you're interested in using Docker to package your apps, we recommend the [dockly](https://github.com/upserve/dockly) gem. Dockly provides a simple DSL for describing Docker containers that install as Debian packages and are controlled by upstart scripts.
|
8
8
|
|
9
9
|
Installation
|
10
10
|
------------
|
data/lib/docker/base.rb
CHANGED
data/lib/docker/connection.rb
CHANGED
data/lib/docker/container.rb
CHANGED
data/lib/docker/error.rb
CHANGED
data/lib/docker/event.rb
CHANGED
data/lib/docker/exec.rb
CHANGED
data/lib/docker/image.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
# This class represents a Docker Image.
|
2
4
|
class Docker::Image
|
3
5
|
include Docker::Base
|
@@ -28,7 +30,7 @@ class Docker::Image
|
|
28
30
|
repo, tag = Docker::Util.parse_repo_tag(repo_tag)
|
29
31
|
raise ArgumentError, "Image does not have a name to push." if repo.nil?
|
30
32
|
|
31
|
-
body = ""
|
33
|
+
body = +""
|
32
34
|
credentials = creds || Docker.creds || {}
|
33
35
|
headers = Docker::Util.build_auth_header(credentials)
|
34
36
|
opts = {:tag => tag}.merge(options)
|
@@ -68,7 +70,7 @@ class Docker::Image
|
|
68
70
|
name = opts.delete(:name)
|
69
71
|
|
70
72
|
unless name
|
71
|
-
if ::Docker.podman?
|
73
|
+
if ::Docker.podman?(connection)
|
72
74
|
name = self.id.split(':').last
|
73
75
|
else
|
74
76
|
name = self.id
|
@@ -119,7 +121,7 @@ class Docker::Image
|
|
119
121
|
def create(opts = {}, creds = nil, conn = Docker.connection, &block)
|
120
122
|
credentials = creds.nil? ? Docker.creds : MultiJson.dump(creds)
|
121
123
|
headers = credentials && Docker::Util.build_auth_header(credentials) || {}
|
122
|
-
body = ''
|
124
|
+
body = +''
|
123
125
|
conn.post(
|
124
126
|
'/images/create',
|
125
127
|
opts,
|
@@ -168,7 +170,7 @@ class Docker::Image
|
|
168
170
|
end
|
169
171
|
nil
|
170
172
|
else
|
171
|
-
string = ''
|
173
|
+
string = +''
|
172
174
|
save_stream(names, {}, conn, &response_block_for_save(string))
|
173
175
|
string
|
174
176
|
end
|
@@ -196,7 +198,7 @@ class Docker::Image
|
|
196
198
|
def load(tar, opts = {}, conn = Docker.connection, creds = nil, &block)
|
197
199
|
headers = build_headers(creds)
|
198
200
|
io = tar.is_a?(String) ? File.open(tar, 'rb') : tar
|
199
|
-
body = ""
|
201
|
+
body = +""
|
200
202
|
conn.post(
|
201
203
|
'/images/load',
|
202
204
|
opts,
|
@@ -267,7 +269,7 @@ class Docker::Image
|
|
267
269
|
|
268
270
|
# Given a Dockerfile as a string, builds an Image.
|
269
271
|
def build(commands, opts = {}, connection = Docker.connection, &block)
|
270
|
-
body = ""
|
272
|
+
body = +""
|
271
273
|
connection.post(
|
272
274
|
'/build', opts,
|
273
275
|
:body => Docker::Util.create_tar('Dockerfile' => commands),
|
@@ -288,7 +290,7 @@ class Docker::Image
|
|
288
290
|
headers = build_headers(creds)
|
289
291
|
|
290
292
|
# The response_block passed to Excon will build up this body variable.
|
291
|
-
body = ""
|
293
|
+
body = +""
|
292
294
|
connection.post(
|
293
295
|
'/build', opts,
|
294
296
|
:headers => headers,
|
@@ -340,7 +342,7 @@ class Docker::Image
|
|
340
342
|
# Convience method to get the Dockerfile for a file hash and a path to
|
341
343
|
# output to.
|
342
344
|
def dockerfile_for(file_hash, output_path)
|
343
|
-
dockerfile = "from #{self.id}\n"
|
345
|
+
dockerfile = +"from #{self.id}\n"
|
344
346
|
|
345
347
|
file_hash.keys.each do |basename|
|
346
348
|
dockerfile << "add #{basename} #{output_path}\n"
|
data/lib/docker/messages.rb
CHANGED
data/lib/docker/network.rb
CHANGED
data/lib/docker/rake_task.rb
CHANGED
data/lib/docker/util.rb
CHANGED
data/lib/docker/version.rb
CHANGED
data/lib/docker/volume.rb
CHANGED
data/lib/docker-api.rb
CHANGED
data/lib/docker.rb
CHANGED
@@ -1,11 +1,15 @@
|
|
1
|
-
|
2
|
-
VALID_REQUEST_KEYS << :hijack_block
|
1
|
+
# frozen_string_literal: true
|
3
2
|
|
3
|
+
module Excon
|
4
4
|
module Middleware
|
5
5
|
# Hijack is an Excon middleware which parses response headers and then
|
6
6
|
# yields the underlying TCP socket for raw TCP communication (used to
|
7
7
|
# attach to STDIN of containers).
|
8
8
|
class Hijack < Base
|
9
|
+
def self.valid_parameter_keys
|
10
|
+
[:hijack_block].freeze
|
11
|
+
end
|
12
|
+
|
9
13
|
def build_response(status, socket)
|
10
14
|
response = {
|
11
15
|
:body => '',
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: docker-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Swipely, Inc.
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-10-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: excon
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.
|
19
|
+
version: 0.64.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.
|
26
|
+
version: 0.64.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: multi_json
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -80,20 +80,6 @@ dependencies:
|
|
80
80
|
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
|
-
name: cane
|
85
|
-
requirement: !ruby/object:Gem::Requirement
|
86
|
-
requirements:
|
87
|
-
- - ">="
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
version: '0'
|
90
|
-
type: :development
|
91
|
-
prerelease: false
|
92
|
-
version_requirements: !ruby/object:Gem::Requirement
|
93
|
-
requirements:
|
94
|
-
- - ">="
|
95
|
-
- !ruby/object:Gem::Version
|
96
|
-
version: '0'
|
97
83
|
- !ruby/object:Gem::Dependency
|
98
84
|
name: pry
|
99
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -175,11 +161,11 @@ files:
|
|
175
161
|
- lib/docker/version.rb
|
176
162
|
- lib/docker/volume.rb
|
177
163
|
- lib/excon/middlewares/hijack.rb
|
178
|
-
homepage: https://github.com/
|
164
|
+
homepage: https://github.com/upserve/docker-api
|
179
165
|
licenses:
|
180
166
|
- MIT
|
181
167
|
metadata: {}
|
182
|
-
post_install_message:
|
168
|
+
post_install_message:
|
183
169
|
rdoc_options: []
|
184
170
|
require_paths:
|
185
171
|
- lib
|
@@ -194,8 +180,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
194
180
|
- !ruby/object:Gem::Version
|
195
181
|
version: '0'
|
196
182
|
requirements: []
|
197
|
-
rubygems_version: 3.
|
198
|
-
signing_key:
|
183
|
+
rubygems_version: 3.1.6
|
184
|
+
signing_key:
|
199
185
|
specification_version: 4
|
200
186
|
summary: A simple REST client for the Docker Remote API
|
201
187
|
test_files: []
|