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 +4 -4
- data/README.md +30 -2
- data/lib/open-dock/docker.rb +7 -3
- data/lib/open-dock/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a90f4844b63083092eb249348d863db04035369a
|
4
|
+
data.tar.gz: f9ce5ecc98239076bb0de40231840a4297c6f314
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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:
|
data/lib/open-dock/docker.rb
CHANGED
@@ -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
|
-
|
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
|
data/lib/open-dock/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2015-01-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|