knife-docker 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +10 -1
- data/lib/chef/knife/docker_create.rb +1 -1
- data/lib/chef/knife/docker_delete.rb +2 -3
- data/lib/knife-docker/version.rb +1 -1
- metadata +2 -2
data/README.md
CHANGED
@@ -16,9 +16,18 @@ This plugin is distributed as a Ruby Gem. To install it, run:
|
|
16
16
|
Depending on your system's configuration, you may need to run this command
|
17
17
|
with root/administrator privileges.
|
18
18
|
|
19
|
-
|
19
|
+
## Prerequisites
|
20
|
+
You need to be able to create/list/stop Docker containers. Please see
|
20
21
|
[the Docker documentation] (https://www.docker.io/gettingstarted/) for more information.
|
21
22
|
|
23
|
+
knife-docker bootstraps your Docker containers via ssh. Make sure the Docker
|
24
|
+
image you are using has the ssh daemon installed, and that you are able to
|
25
|
+
login:
|
26
|
+
|
27
|
+
id=$(docker run -d -p 22 $IMAGE /usr/sbin/sshd -D)
|
28
|
+
port=$(docker port $id 22)
|
29
|
+
ssh root@localhost -p $port
|
30
|
+
|
22
31
|
## Examples
|
23
32
|
# Create and bootstrap a Debian container over ssh
|
24
33
|
$ knife docker create -I emarocca/wheezy
|
@@ -100,7 +100,7 @@ module ChefDocker
|
|
100
100
|
|
101
101
|
# get container IP
|
102
102
|
container_info = `docker inspect #{id}`
|
103
|
-
ip = container_info.match(/"IPAddress": "(
|
103
|
+
ip = container_info.match(/"IPAddress": "([\d\.]+)"/)[1]
|
104
104
|
|
105
105
|
# containers boot *very* fast, but it might happen that we try to
|
106
106
|
# bootstrap before SSH is up. Let's wait a second.
|
@@ -41,9 +41,8 @@ module ChefDocker
|
|
41
41
|
running_containers = []
|
42
42
|
|
43
43
|
`docker ps`.split(/\n/).each do |c|
|
44
|
-
|
45
|
-
|
46
|
-
running_containers.push match['id']
|
44
|
+
if c =~ /^[\d\w]{12}\s/
|
45
|
+
running_containers.push c.split[0]
|
47
46
|
end
|
48
47
|
end
|
49
48
|
|
data/lib/knife-docker/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: knife-docker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-10-
|
12
|
+
date: 2013-10-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: chef
|