docker-api 1.3.1 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +5 -1
  3. data/lib/docker/container.rb +7 -0
  4. data/lib/docker/version.rb +2 -2
  5. data/spec/docker/container_spec.rb +21 -6
  6. data/spec/docker/image_spec.rb +1 -3
  7. data/spec/docker_spec.rb +2 -1
  8. data/spec/vcr/Docker/_info/returns_the_info_as_a_Hash.yml +12 -15
  9. data/spec/vcr/Docker/_validate_version/when_nothing_is_raised/validate_version_/.yml +12 -15
  10. data/spec/vcr/Docker/_version/returns_the_version_as_a_Hash.yml +12 -15
  11. data/spec/vcr/Docker_Container/_all/when_the_HTTP_response_is_a_200/materializes_each_Container_into_a_Docker_Container.yml +207 -3364
  12. data/spec/vcr/Docker_Container/_attach/yields_each_chunk.yml +31 -39
  13. data/spec/vcr/Docker_Container/_changes/returns_the_changes_as_an_array.yml +45 -57
  14. data/spec/vcr/Docker_Container/_commit/creates_a_new_Image_from_the_Container_s_changes.yml +34 -43
  15. data/spec/vcr/Docker_Container/_create/when_the_Container_does_not_yet_exist_and_the_body_is_a_Hash/when_the_HTTP_request_returns_a_200/sets_the_id.yml +13 -16
  16. data/spec/vcr/Docker_Container/_export/yields_each_chunk.yml +52 -47
  17. data/spec/vcr/Docker_Container/_json/returns_the_description_as_a_Hash.yml +24 -30
  18. data/spec/vcr/Docker_Container/_kill/kills_the_container.yml +121 -1712
  19. data/spec/vcr/Docker_Container/_restart/restarts_the_container.yml +78 -99
  20. data/spec/vcr/Docker_Container/_run/when_the_Container_s_command_does_not_return_status_code_of_0/raises_an_error.yml +34 -43
  21. data/spec/vcr/Docker_Container/_run/when_the_Container_s_command_returns_a_status_code_of_0/creates_a_new_container_to_run_the_specified_command.yml +90 -116
  22. data/spec/vcr/Docker_Container/_start/starts_the_container.yml +35 -44
  23. data/spec/vcr/Docker_Container/_stop/stops_the_container.yml +131 -1724
  24. data/spec/vcr/Docker_Container/_top/returns_the_top_commands_as_an_Array.yml +84 -0
  25. data/spec/vcr/Docker_Container/_wait/waits_for_the_command_to_finish.yml +34 -43
  26. data/spec/vcr/Docker_Container/_wait/when_an_argument_is_given/and_a_command_runs_for_too_long/raises_a_ServerError.yml +23 -29
  27. data/spec/vcr/Docker_Container/_wait/when_an_argument_is_given/sets_the_read_timeout_to_that_amount_of_time.yml +34 -43
  28. data/spec/vcr/Docker_Image/_all/materializes_each_Image_into_a_Docker_Image.yml +25 -32
  29. data/spec/vcr/Docker_Image/_build/with_a_valid_Dockerfile/builds_an_image.yml +43 -20
  30. data/spec/vcr/Docker_Image/_build/with_an_invalid_Dockerfile/throws_a_UnexpectedResponseError.yml +41 -23
  31. data/spec/vcr/Docker_Image/_create/when_the_Image_does_not_yet_exist_and_the_body_is_a_Hash/sets_the_id.yml +12 -16
  32. data/spec/vcr/Docker_Image/_history/returns_the_history_of_the_Image.yml +23 -30
  33. data/spec/vcr/Docker_Image/_insert/inserts_the_url_s_file_into_a_new_Image.yml +113 -99
  34. data/spec/vcr/Docker_Image/_json/returns_additional_information_about_image_image.yml +23 -30
  35. data/spec/vcr/Docker_Image/_remove/removes_the_Image.yml +34 -44
  36. data/spec/vcr/Docker_Image/_run/when_the_argument_is_a_String/splits_the_String_by_spaces_and_creates_a_new_Container.yml +42 -54
  37. data/spec/vcr/Docker_Image/_run/when_the_argument_is_an_Array/creates_a_new_Container.yml +42 -54
  38. data/spec/vcr/Docker_Image/_search/materializes_each_Image_into_a_Docker_Image.yml +15 -17
  39. data/spec/vcr/Docker_Image/_tag/tags_the_image_with_the_repo_name.yml +22 -29
  40. metadata +4 -6
  41. data/spec/vcr/Docker_Image/_build_from_dir/with_a_valid_Dockerfile/builds_the_image.yml +0 -124
  42. data/spec/vcr/Docker_Image/_import/when_the_file_does_exist/creates_the_Image.yml +0 -35
@@ -2,37 +2,34 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: post
5
- uri: http://localhost:4243/v1.3/containers/create
5
+ uri: http://localhost:4243/v1.4/containers/create
6
6
  body:
7
7
  encoding: UTF-8
8
- string: ! '{"Cmd":["uname","-r"],"Image":"base"}'
8
+ string: '{"Cmd":["pwd"],"Image":"base"}'
9
9
  headers:
10
10
  Content-Type:
11
11
  - text/plain
12
12
  User-Agent:
13
- - Docker-Client/0.4.6
13
+ - Swipely/Docker-API 1.3.1
14
14
  response:
15
15
  status:
16
16
  code: 201
17
17
  message: ''
18
18
  headers:
19
- !binary "Q29udGVudC1UeXBl":
20
- - !binary |-
21
- dGV4dC9wbGFpbjsgY2hhcnNldD11dGYtOA==
22
- !binary "Q29udGVudC1MZW5ndGg=":
23
- - !binary |-
24
- MjE=
25
- !binary "RGF0ZQ==":
26
- - !binary |-
27
- V2VkLCAyNiBKdW4gMjAxMyAxODowOTo1MCBHTVQ=
19
+ Content-Type:
20
+ - text/plain; charset=utf-8
21
+ Content-Length:
22
+ - '21'
23
+ Date:
24
+ - Wed, 07 Aug 2013 16:51:14 GMT
28
25
  body:
29
- encoding: US-ASCII
30
- string: ! '{"Id":"81398655b7a2"}'
26
+ encoding: UTF-8
27
+ string: '{"Id":"fe03763be9b4"}'
31
28
  http_version:
32
- recorded_at: Wed, 26 Jun 2013 18:09:50 GMT
29
+ recorded_at: Wed, 07 Aug 2013 16:51:14 GMT
33
30
  - request:
34
31
  method: post
35
- uri: http://localhost:4243/v1.3/containers/81398655b7a2/start
32
+ uri: http://localhost:4243/v1.4/containers/fe03763be9b4/start
36
33
  body:
37
34
  encoding: US-ASCII
38
35
  string: ''
@@ -40,29 +37,26 @@ http_interactions:
40
37
  Content-Type:
41
38
  - text/plain
42
39
  User-Agent:
43
- - Docker-Client/0.4.6
40
+ - Swipely/Docker-API 1.3.1
44
41
  response:
45
42
  status:
46
43
  code: 204
47
44
  message: ''
48
45
  headers:
49
- !binary "Q29udGVudC1UeXBl":
50
- - !binary |-
51
- dGV4dC9wbGFpbjsgY2hhcnNldD11dGYtOA==
52
- !binary "Q29udGVudC1MZW5ndGg=":
53
- - !binary |-
54
- MA==
55
- !binary "RGF0ZQ==":
56
- - !binary |-
57
- V2VkLCAyNiBKdW4gMjAxMyAxODowOTo1MCBHTVQ=
46
+ Content-Type:
47
+ - text/plain; charset=utf-8
48
+ Content-Length:
49
+ - '0'
50
+ Date:
51
+ - Wed, 07 Aug 2013 16:51:14 GMT
58
52
  body:
59
- encoding: US-ASCII
53
+ encoding: UTF-8
60
54
  string: ''
61
55
  http_version:
62
- recorded_at: Wed, 26 Jun 2013 18:09:50 GMT
56
+ recorded_at: Wed, 07 Aug 2013 16:51:14 GMT
63
57
  - request:
64
58
  method: post
65
- uri: http://localhost:4243/v1.3/containers/81398655b7a2/attach?stdout=true&stream=true
59
+ uri: http://localhost:4243/v1.4/containers/fe03763be9b4/attach?stdout=true&stream=true
66
60
  body:
67
61
  encoding: US-ASCII
68
62
  string: ''
@@ -70,20 +64,18 @@ http_interactions:
70
64
  Content-Type:
71
65
  - text/plain
72
66
  User-Agent:
73
- - Docker-Client/0.4.6
67
+ - Swipely/Docker-API 1.3.1
74
68
  response:
75
69
  status:
76
70
  code: 200
77
71
  message: ''
78
72
  headers:
79
- !binary "Q29udGVudC1UeXBl":
80
- - !binary |-
81
- YXBwbGljYXRpb24vdm5kLmRvY2tlci5yYXctc3RyZWFt
73
+ Content-Type:
74
+ - application/vnd.docker.raw-stream
82
75
  body:
83
- encoding: US-ASCII
84
- string: ! '3.8.0-25-generic
85
-
86
- '
76
+ encoding: UTF-8
77
+ string: |
78
+ /
87
79
  http_version:
88
- recorded_at: Wed, 26 Jun 2013 18:09:51 GMT
89
- recorded_with: VCR 2.5.0
80
+ recorded_at: Wed, 07 Aug 2013 16:51:14 GMT
81
+ recorded_with: VCR 2.4.0
@@ -2,37 +2,34 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: post
5
- uri: http://localhost:4243/v1.3/containers/create
5
+ uri: http://localhost:4243/v1.4/containers/create
6
6
  body:
7
7
  encoding: UTF-8
8
- string: ! '{"Cmd":["true"],"Image":"base"}'
8
+ string: '{"Cmd":["rm","-rf","/root"],"Image":"base"}'
9
9
  headers:
10
10
  Content-Type:
11
11
  - text/plain
12
12
  User-Agent:
13
- - Docker-Client/0.4.6
13
+ - Swipely/Docker-API 1.3.1
14
14
  response:
15
15
  status:
16
16
  code: 201
17
17
  message: ''
18
18
  headers:
19
- !binary "Q29udGVudC1UeXBl":
20
- - !binary |-
21
- dGV4dC9wbGFpbjsgY2hhcnNldD11dGYtOA==
22
- !binary "Q29udGVudC1MZW5ndGg=":
23
- - !binary |-
24
- MjE=
25
- !binary "RGF0ZQ==":
26
- - !binary |-
27
- V2VkLCAyNiBKdW4gMjAxMyAxODowOTo0NyBHTVQ=
19
+ Content-Type:
20
+ - text/plain; charset=utf-8
21
+ Content-Length:
22
+ - '21'
23
+ Date:
24
+ - Wed, 07 Aug 2013 16:51:12 GMT
28
25
  body:
29
- encoding: US-ASCII
30
- string: ! '{"Id":"0eefbdc27421"}'
26
+ encoding: UTF-8
27
+ string: '{"Id":"04f3e636c31d"}'
31
28
  http_version:
32
- recorded_at: Wed, 26 Jun 2013 18:09:47 GMT
29
+ recorded_at: Wed, 07 Aug 2013 16:51:12 GMT
33
30
  - request:
34
31
  method: post
35
- uri: http://localhost:4243/v1.3/containers/0eefbdc27421/start
32
+ uri: http://localhost:4243/v1.4/containers/04f3e636c31d/start
36
33
  body:
37
34
  encoding: US-ASCII
38
35
  string: ''
@@ -40,29 +37,26 @@ http_interactions:
40
37
  Content-Type:
41
38
  - text/plain
42
39
  User-Agent:
43
- - Docker-Client/0.4.6
40
+ - Swipely/Docker-API 1.3.1
44
41
  response:
45
42
  status:
46
43
  code: 204
47
44
  message: ''
48
45
  headers:
49
- !binary "Q29udGVudC1UeXBl":
50
- - !binary |-
51
- dGV4dC9wbGFpbjsgY2hhcnNldD11dGYtOA==
52
- !binary "Q29udGVudC1MZW5ndGg=":
53
- - !binary |-
54
- MA==
55
- !binary "RGF0ZQ==":
56
- - !binary |-
57
- V2VkLCAyNiBKdW4gMjAxMyAxODowOTo0NyBHTVQ=
46
+ Content-Type:
47
+ - text/plain; charset=utf-8
48
+ Content-Length:
49
+ - '0'
50
+ Date:
51
+ - Wed, 07 Aug 2013 16:51:12 GMT
58
52
  body:
59
- encoding: US-ASCII
53
+ encoding: UTF-8
60
54
  string: ''
61
55
  http_version:
62
- recorded_at: Wed, 26 Jun 2013 18:09:47 GMT
56
+ recorded_at: Wed, 07 Aug 2013 16:51:12 GMT
63
57
  - request:
64
58
  method: post
65
- uri: http://localhost:4243/v1.3/containers/0eefbdc27421/wait
59
+ uri: http://localhost:4243/v1.4/containers/04f3e636c31d/wait
66
60
  body:
67
61
  encoding: US-ASCII
68
62
  string: ''
@@ -70,29 +64,26 @@ http_interactions:
70
64
  Content-Type:
71
65
  - text/plain
72
66
  User-Agent:
73
- - Docker-Client/0.4.6
67
+ - Swipely/Docker-API 1.3.1
74
68
  response:
75
69
  status:
76
70
  code: 200
77
71
  message: ''
78
72
  headers:
79
- !binary "Q29udGVudC1UeXBl":
80
- - !binary |-
81
- YXBwbGljYXRpb24vanNvbg==
82
- !binary "Q29udGVudC1MZW5ndGg=":
83
- - !binary |-
84
- MTY=
85
- !binary "RGF0ZQ==":
86
- - !binary |-
87
- V2VkLCAyNiBKdW4gMjAxMyAxODowOTo0OCBHTVQ=
73
+ Content-Type:
74
+ - application/json
75
+ Content-Length:
76
+ - '16'
77
+ Date:
78
+ - Wed, 07 Aug 2013 16:51:12 GMT
88
79
  body:
89
- encoding: US-ASCII
90
- string: ! '{"StatusCode":0}'
80
+ encoding: UTF-8
81
+ string: '{"StatusCode":0}'
91
82
  http_version:
92
- recorded_at: Wed, 26 Jun 2013 18:09:48 GMT
83
+ recorded_at: Wed, 07 Aug 2013 16:51:12 GMT
93
84
  - request:
94
85
  method: get
95
- uri: http://localhost:4243/v1.3/containers/0eefbdc27421/changes
86
+ uri: http://localhost:4243/v1.4/containers/04f3e636c31d/changes
96
87
  body:
97
88
  encoding: US-ASCII
98
89
  string: ''
@@ -100,24 +91,21 @@ http_interactions:
100
91
  Content-Type:
101
92
  - text/plain
102
93
  User-Agent:
103
- - Docker-Client/0.4.6
94
+ - Swipely/Docker-API 1.3.1
104
95
  response:
105
96
  status:
106
97
  code: 200
107
98
  message: ''
108
99
  headers:
109
- !binary "Q29udGVudC1UeXBl":
110
- - !binary |-
111
- YXBwbGljYXRpb24vanNvbg==
112
- !binary "Q29udGVudC1MZW5ndGg=":
113
- - !binary |-
114
- NTY=
115
- !binary "RGF0ZQ==":
116
- - !binary |-
117
- V2VkLCAyNiBKdW4gMjAxMyAxODowOTo0OCBHTVQ=
100
+ Content-Type:
101
+ - application/json
102
+ Content-Length:
103
+ - '27'
104
+ Date:
105
+ - Wed, 07 Aug 2013 16:51:12 GMT
118
106
  body:
119
- encoding: US-ASCII
120
- string: ! '[{"Path":"/dev","Kind":0},{"Path":"/dev/kmsg","Kind":1}]'
107
+ encoding: UTF-8
108
+ string: '[{"Path":"/root","Kind":2}]'
121
109
  http_version:
122
- recorded_at: Wed, 26 Jun 2013 18:09:48 GMT
123
- recorded_with: VCR 2.5.0
110
+ recorded_at: Wed, 07 Aug 2013 16:51:12 GMT
111
+ recorded_with: VCR 2.4.0
@@ -2,37 +2,34 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: post
5
- uri: http://localhost:4243/v1.3/containers/create
5
+ uri: http://localhost:4243/v1.4/containers/create
6
6
  body:
7
7
  encoding: UTF-8
8
- string: ! '{"Cmd":["true"],"Image":"base"}'
8
+ string: '{"Cmd":["true"],"Image":"base"}'
9
9
  headers:
10
10
  Content-Type:
11
11
  - text/plain
12
12
  User-Agent:
13
- - Docker-Client/0.4.6
13
+ - Swipely/Docker-API 1.3.1
14
14
  response:
15
15
  status:
16
16
  code: 201
17
17
  message: ''
18
18
  headers:
19
- !binary "Q29udGVudC1UeXBl":
20
- - !binary |-
21
- dGV4dC9wbGFpbjsgY2hhcnNldD11dGYtOA==
22
- !binary "Q29udGVudC1MZW5ndGg=":
23
- - !binary |-
24
- MjE=
25
- !binary "RGF0ZQ==":
26
- - !binary |-
27
- V2VkLCAyNiBKdW4gMjAxMyAxODoxMDowNiBHTVQ=
19
+ Content-Type:
20
+ - text/plain; charset=utf-8
21
+ Content-Length:
22
+ - '21'
23
+ Date:
24
+ - Wed, 07 Aug 2013 16:51:31 GMT
28
25
  body:
29
- encoding: US-ASCII
30
- string: ! '{"Id":"a6fa364fc109"}'
26
+ encoding: UTF-8
27
+ string: '{"Id":"f46aa3aea35f"}'
31
28
  http_version:
32
- recorded_at: Wed, 26 Jun 2013 18:10:06 GMT
29
+ recorded_at: Wed, 07 Aug 2013 16:51:31 GMT
33
30
  - request:
34
31
  method: post
35
- uri: http://localhost:4243/v1.3/containers/a6fa364fc109/start
32
+ uri: http://localhost:4243/v1.4/containers/f46aa3aea35f/start
36
33
  body:
37
34
  encoding: US-ASCII
38
35
  string: ''
@@ -40,29 +37,26 @@ http_interactions:
40
37
  Content-Type:
41
38
  - text/plain
42
39
  User-Agent:
43
- - Docker-Client/0.4.6
40
+ - Swipely/Docker-API 1.3.1
44
41
  response:
45
42
  status:
46
43
  code: 204
47
44
  message: ''
48
45
  headers:
49
- !binary "Q29udGVudC1UeXBl":
50
- - !binary |-
51
- dGV4dC9wbGFpbjsgY2hhcnNldD11dGYtOA==
52
- !binary "Q29udGVudC1MZW5ndGg=":
53
- - !binary |-
54
- MA==
55
- !binary "RGF0ZQ==":
56
- - !binary |-
57
- V2VkLCAyNiBKdW4gMjAxMyAxODoxMDowNiBHTVQ=
46
+ Content-Type:
47
+ - text/plain; charset=utf-8
48
+ Content-Length:
49
+ - '0'
50
+ Date:
51
+ - Wed, 07 Aug 2013 16:51:31 GMT
58
52
  body:
59
- encoding: US-ASCII
53
+ encoding: UTF-8
60
54
  string: ''
61
55
  http_version:
62
- recorded_at: Wed, 26 Jun 2013 18:10:06 GMT
56
+ recorded_at: Wed, 07 Aug 2013 16:51:31 GMT
63
57
  - request:
64
58
  method: post
65
- uri: http://localhost:4243/v1.3/commit?container=a6fa364f
59
+ uri: http://localhost:4243/v1.4/commit?container=f46aa3ae
66
60
  body:
67
61
  encoding: US-ASCII
68
62
  string: ''
@@ -70,24 +64,21 @@ http_interactions:
70
64
  Content-Type:
71
65
  - text/plain
72
66
  User-Agent:
73
- - Docker-Client/0.4.6
67
+ - Swipely/Docker-API 1.3.1
74
68
  response:
75
69
  status:
76
70
  code: 201
77
71
  message: ''
78
72
  headers:
79
- !binary "Q29udGVudC1UeXBl":
80
- - !binary |-
81
- dGV4dC9wbGFpbjsgY2hhcnNldD11dGYtOA==
82
- !binary "Q29udGVudC1MZW5ndGg=":
83
- - !binary |-
84
- MjE=
85
- !binary "RGF0ZQ==":
86
- - !binary |-
87
- V2VkLCAyNiBKdW4gMjAxMyAxODoxMDowNiBHTVQ=
73
+ Content-Type:
74
+ - text/plain; charset=utf-8
75
+ Content-Length:
76
+ - '21'
77
+ Date:
78
+ - Wed, 07 Aug 2013 16:51:31 GMT
88
79
  body:
89
- encoding: US-ASCII
90
- string: ! '{"Id":"eb0d94457679"}'
80
+ encoding: UTF-8
81
+ string: '{"Id":"c8fab65ab6d9"}'
91
82
  http_version:
92
- recorded_at: Wed, 26 Jun 2013 18:10:06 GMT
93
- recorded_with: VCR 2.5.0
83
+ recorded_at: Wed, 07 Aug 2013 16:51:31 GMT
84
+ recorded_with: VCR 2.4.0
@@ -2,32 +2,29 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: post
5
- uri: http://localhost:4243/v1.3/containers/create
5
+ uri: http://localhost:4243/v1.4/containers/create
6
6
  body:
7
7
  encoding: UTF-8
8
- string: ! '{"Hostname":"","User":"","Memory":0,"MemorySwap":0,"AttachStdin":false,"AttachStdout":false,"AttachStderr":false,"PortSpecs":null,"Tty":false,"OpenStdin":false,"StdinOnce":false,"Env":null,"Cmd":["date"],"Dns":null,"Image":"base","Volumes":{},"VolumesFrom":""}'
8
+ string: '{"Hostname":"","User":"","Memory":0,"MemorySwap":0,"AttachStdin":false,"AttachStdout":false,"AttachStderr":false,"PortSpecs":null,"Tty":false,"OpenStdin":false,"StdinOnce":false,"Env":null,"Cmd":["date"],"Dns":null,"Image":"base","Volumes":{},"VolumesFrom":""}'
9
9
  headers:
10
10
  Content-Type:
11
11
  - text/plain
12
12
  User-Agent:
13
- - Docker-Client/0.4.6
13
+ - Swipely/Docker-API 1.3.1
14
14
  response:
15
15
  status:
16
16
  code: 201
17
17
  message: ''
18
18
  headers:
19
- !binary "Q29udGVudC1UeXBl":
20
- - !binary |-
21
- dGV4dC9wbGFpbjsgY2hhcnNldD11dGYtOA==
22
- !binary "Q29udGVudC1MZW5ndGg=":
23
- - !binary |-
24
- MjE=
25
- !binary "RGF0ZQ==":
26
- - !binary |-
27
- V2VkLCAyNiBKdW4gMjAxMyAxODoxMDowNyBHTVQ=
19
+ Content-Type:
20
+ - text/plain; charset=utf-8
21
+ Content-Length:
22
+ - '21'
23
+ Date:
24
+ - Wed, 07 Aug 2013 16:51:31 GMT
28
25
  body:
29
- encoding: US-ASCII
30
- string: ! '{"Id":"cb24f1c8b1f9"}'
26
+ encoding: UTF-8
27
+ string: '{"Id":"dd04be708f2e"}'
31
28
  http_version:
32
- recorded_at: Wed, 26 Jun 2013 18:10:07 GMT
33
- recorded_with: VCR 2.5.0
29
+ recorded_at: Wed, 07 Aug 2013 16:51:31 GMT
30
+ recorded_with: VCR 2.4.0