open-dock 0.1.5 → 0.1.6

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: 6158bd28ab0c340c53b9dc9fe6019de1d0b60f17
4
- data.tar.gz: 23d656ae3e8bfc3211790759491273caabb29dcd
3
+ metadata.gz: a90f4844b63083092eb249348d863db04035369a
4
+ data.tar.gz: f9ce5ecc98239076bb0de40231840a4297c6f314
5
5
  SHA512:
6
- metadata.gz: 1571e13622d09bf5af5e036fc6ae1c8967d0b5cdb042f80457ad188e5a3f4b5ae8e639f9c8609d6f9b5da805494b4fefa0d4dcfff851ec5ed0941bc7926ba75e
7
- data.tar.gz: 3c7d3ac8960b24d189c52790595b532e4839b8c280a2857da7e0cf96cc5cf5850f2a2446fbe2f92f20d4291fb0dfdfb1c204da847fc11b7fce114415f39bd29b
6
+ metadata.gz: 168c4982f31df7b36926b837d3d8a5145a52e55d625406906fc95b26702a533f06783f8eac248acd580a81e1e83be5d40766a276e1e5e18561b7ee77306185f8
7
+ data.tar.gz: 390c024ee53331ea76cd60aa263f71437a3c64584633449abb0d7dc5afc8b2557fe41d6f4d35892bdfe77335aca414f7e49c091e19c4d5184cbe767bd0feaab2
data/README.md CHANGED
@@ -120,6 +120,8 @@ disk_size_gb: 10
120
120
 
121
121
  ##Configure hosted CONTAINERS (Docker)
122
122
 
123
+ To use this command you need [Docker](https://docs.docker.com/installation/) installed in the server.
124
+
123
125
  In this file we can configure all containers to run in the host provided in the name:
124
126
 
125
127
  ```yml
@@ -150,7 +152,7 @@ www:
150
152
 
151
153
  `ops ship example.com` will create all containers configured on 'containers/example.com.yml' file
152
154
 
153
- Note: host SSH credentials (id_rsa.pub and authorized_keys) are copied by default to container, in order to have the same access to conainer.
155
+ Note: host SSH credentials (id_rsa.pub and authorized_keys) are copied by default to container, in order to have the same access to container.
154
156
 
155
157
  ### Shipping your local Docker
156
158
 
@@ -166,6 +168,11 @@ By convention:
166
168
 
167
169
  ## Configure Containers (are nodes for Chef)
168
170
 
171
+ To use this command you need:
172
+
173
+ * Chef installed in your nodes
174
+ * SSHd running in your nodes
175
+
169
176
  Configuration with chef commands
170
177
 
171
178
  * `ops configure HOST_NAME`: configure with chef all containers in host. Here you need to install knife-solo gem.
@@ -174,9 +181,30 @@ Configuration with chef commands
174
181
 
175
182
  By convention:
176
183
 
177
- * "root" is the user in all containers
184
+ * "root" is the user by default in all containers
178
185
  * Each container configuration is defined in a Chef node: `nodes/[host_name]/[container_name].json`
179
186
 
187
+ ```
188
+ # Configure all containers in 'example.com' host
189
+ ops configure example.com
190
+ # Configure 'www' container in 'example.com' host
191
+ ops configure example.com --container www
192
+ # == knife solo cook root@example.com nodes/example.com/www.json -p 2222
193
+ ```
194
+
195
+ ## SSH connections
196
+
197
+ SSH connection to host or container:
198
+
199
+ ```
200
+ ops ssh HOST_NAME [CONTAINER_NAME]
201
+ ```
202
+
203
+ Assuming SSHd installed in containers and hosts, you can
204
+
205
+ * Access to host: `ops ssh example.com` equivalent to `ssh root@example.com`
206
+ * Access to 'www' container: `ops ssh example.com www` equivalent to `ssh root@example.com -p 2222`
207
+
180
208
  ## Commands
181
209
 
182
210
  Create/delete domain names, create/delete hosts and ship/unship hosts:
@@ -16,16 +16,20 @@ module Docker
16
16
 
17
17
  def self.copy_ssh_credentials_command(container_name)
18
18
  <<-EOH
19
+ ID=$(docker inspect -f '{{.Id}}' #{container_name})
19
20
  # Container folder
20
21
  if sudo test -d "/var/lib/docker/aufs"; then
21
22
  CONTAINERS_DIR=/var/lib/docker/aufs/mnt
23
+ SSH_DIR=$CONTAINERS_DIR/$ID/root/.ssh
22
24
  elif sudo test -d "/var/lib/docker/btrfs"; then
23
25
  CONTAINERS_DIR=/var/lib/docker/btrfs/subvolumes
26
+ SSH_DIR=$CONTAINERS_DIR/$ID/root/.ssh
27
+ elif sudo test -d "/var/lib/docker/devicemapper"; then
28
+ CONTAINERS_DIR=/var/lib/docker/devicemapper/mnt
29
+ SSH_DIR=$CONTAINERS_DIR/$ID/rootfs/root/.ssh
24
30
  fi
25
31
 
26
- ID=$(docker inspect -f '{{.Id}}' #{container_name})
27
- SSH_DIR=$CONTAINERS_DIR/$ID/root/.ssh
28
- echo SSH container folder is $SSH_DIR
32
+ echo SSH container folder: $SSH_DIR
29
33
  if sudo test ! -d "$SSH_DIR" ; then
30
34
  sudo mkdir $SSH_DIR
31
35
  fi
@@ -1,3 +1,3 @@
1
1
  module OpenDock
2
- VERSION = "0.1.5"
2
+ VERSION = "0.1.6"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: open-dock
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juan Lebrijo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-18 00:00:00.000000000 Z
11
+ date: 2015-01-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler