docker-api 1.33.4 → 1.33.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bc4cc0582b0d1790debfb8be47bb928f5c1a92c8
4
- data.tar.gz: ec329aa7f8fcbdf7991faa44ca5a54cb962d8dc0
3
+ metadata.gz: feaf132a5bd3b3aa9bd58bd2f0741135cedc676f
4
+ data.tar.gz: 4298604d6b131a80e6d2be772c7730b474a415d2
5
5
  SHA512:
6
- metadata.gz: 707a35dfc34923c91c0f41971c1932749b932396a8a3f8b345630754a07113faa23be27a8af5b4838c4ed6b8f783e24e49d1e416fbfb9a98734f9ee9a246f7e1
7
- data.tar.gz: c40703a85329908dc1ca5654fc4e59af856db02504e6b50029f2170f4e465d6d39984aee1b417abfe0c36145578ab2df9263b3b6c6362b4ea4fdb499e7d39a60
6
+ metadata.gz: b5959dd544f98292d00b4c81ecc18292f1f152a12840109b56bdbb948bba7c1ad9755120822c8edd1ae680f9699bdc7946c8fd09e59749982c419bff71433e81
7
+ data.tar.gz: 82e462599091c8234f832ad5fa7d7739b7826161a05784862e756d2a512686f7466e199c2a2c6888c60ff0dde17aea55b5478475d41b646e482f8a90e231a02a
data/README.md CHANGED
@@ -130,6 +130,10 @@ Docker.info
130
130
  # docker command for reference: docker login
131
131
  Docker.authenticate!('username' => 'docker-fan-boi', 'password' => 'i<3docker', 'email' => 'dockerboy22@aol.com')
132
132
  # => true
133
+
134
+ # docker command for reference: docker login registry.gitlab.com
135
+ Docker.authenticate!('username' => 'docker-fan-boi', 'password' => 'i<3docker', 'email' => 'dockerboy22@aol.com', 'serveraddress' => 'https://registry.gitlab.com/v1/')
136
+ # => true
133
137
  ```
134
138
 
135
139
  ## Images
@@ -12,11 +12,11 @@ class Docker::Image
12
12
  begin
13
13
  Docker::Container.create(opts, connection)
14
14
  .tap(&:start!)
15
- rescue ServerError => ex
15
+ rescue ServerError, ClientError => ex
16
16
  if cmd
17
17
  raise ex
18
18
  else
19
- raise ServerError, "No command specified."
19
+ raise ex, "No command specified."
20
20
  end
21
21
  end
22
22
  end
@@ -117,7 +117,10 @@ class Docker::Image
117
117
  :headers => headers,
118
118
  :response_block => response_block(body, &block)
119
119
  )
120
+ # NOTE: see associated tests for why we're looking at image#end_with?
120
121
  image = opts['fromImage'] || opts[:fromImage]
122
+ tag = opts['tag'] || opts[:tag]
123
+ image = "#{image}:#{tag}" if tag && !image.end_with?(":#{tag}")
121
124
  get(image, {}, conn)
122
125
  end
123
126
 
@@ -233,7 +233,7 @@ module Docker::Util
233
233
 
234
234
  def build_auth_header(credentials)
235
235
  credentials = credentials.to_json if credentials.is_a?(Hash)
236
- encoded_creds = Base64.encode64(credentials).gsub(/\n/, '')
236
+ encoded_creds = Base64.urlsafe_encode64(credentials)
237
237
  {
238
238
  'X-Registry-Auth' => encoded_creds
239
239
  }
@@ -251,7 +251,7 @@ module Docker::Util
251
251
  }
252
252
  }.to_json
253
253
 
254
- encoded_header = Base64.encode64(header).gsub(/\n/, '')
254
+ encoded_header = Base64.urlsafe_encode64(header)
255
255
 
256
256
  {
257
257
  'X-Registry-Config' => encoded_header
@@ -1,6 +1,6 @@
1
1
  module Docker
2
2
  # The version of the docker-api gem.
3
- VERSION = '1.33.4'
3
+ VERSION = '1.33.5'
4
4
 
5
5
  # The version of the compatible Docker remote API.
6
6
  API_VERSION = '1.16'
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: 1.33.4
4
+ version: 1.33.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Swipely, Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-04-10 00:00:00.000000000 Z
11
+ date: 2017-06-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: excon