docker-app 0.2.1 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b94ddc0babcbbed29c5565edfe0381e573cc8aa1
4
- data.tar.gz: 403e6ec1bfc0ba1f9e31a20bc1beba17c831188e
3
+ metadata.gz: e39d7fc1786b5e284003a532dff26939c80b6cc7
4
+ data.tar.gz: 81be2179584033847ca7a2a6beacc3d8136bfc21
5
5
  SHA512:
6
- metadata.gz: bd355705b85e9d50a2de278d64e631a2eb41bf8b9ff27f639c9acbdf4955af101364f83ecf5fbc99276c3341bc5183b751fdce04ea079e840e9286491ad78a50
7
- data.tar.gz: 4b61d2d2c3741ca33fe1142680552685bc8e3c9881c5d583fa29de799be3a877b3e84b30fbee9fea2618688ef10391cacb63c09006fd2f92a5f416126f8095c8
6
+ metadata.gz: aedbbaf025c5c1f44f492a97fb32a13d5fe6d2699e5d765842692918b56cd6cf1b58d663b61ddd47f46e66625551d692a3487f1574d9f5f4f2a6afdf6dc29e02
7
+ data.tar.gz: 9a0e822ae2259d8dd1bb79b5f62babc257183d447334687bd7b5e6a2f3b18966ad51a60b89721486be2e3a4ae9e7208a98e610f96445997c696a28ef0d34a33e
data/docker-app.gemspec CHANGED
@@ -12,7 +12,7 @@ Gem::Specification.new do |spec|
12
12
  spec.email = ["max.ivak@gmail.com"]
13
13
 
14
14
  spec.summary = 'Docker application installer'
15
- spec.description = "Install Docker containers with Chef, Dockerfile and other tools"
15
+ spec.description = "Run Docker containers and provision with Chef, shell and other tools"
16
16
  spec.homepage = "https://github.com/maxivak/docker-app"
17
17
  spec.license = "MIT"
18
18
 
@@ -139,8 +139,10 @@ module DockerApp
139
139
  def self._run_bootstrap_script_in_container_shell(settings, script)
140
140
  script_path = script['script']
141
141
 
142
+ exec_options = script['exec_options'] || ''
143
+
142
144
  # exec
143
- cmd %Q(docker exec #{settings.container_name} #{script_path} )
145
+ cmd %Q(docker exec #{exec_options} #{settings.container_name} #{script_path} )
144
146
  end
145
147
 
146
148
  def self._run_bootstrap_script_in_container_chef(settings, script)
@@ -1,3 +1,3 @@
1
1
  module DockerApp
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.2"
3
3
  end
data/readme.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # Docker app
2
2
 
3
3
  Docker app is a tool to install and setup Docker containers.
4
- It uses Dockerfile, Chef and other provisioning tools.
4
+ It uses Dockerfile, Chef and other tools for provisioning.
5
5
 
6
6
  Features:
7
7
  * Config files are in Ruby.
@@ -18,7 +18,7 @@ Docker-app is similar to docker-compose but has some more functionality to custo
18
18
 
19
19
  # Overview
20
20
 
21
- Process of installing server in Docker container consists of the following stages:
21
+ Process of installing server in Docker container has the following stages:
22
22
 
23
23
  Process of building and running container on the host machine:
24
24
  * Build Docker image
@@ -851,3 +851,68 @@ ip route
851
851
 
852
852
  * [Nginx with Mysql](https://github.com/maxivak/docker-nginx-mysql-example)
853
853
 
854
+
855
+ ## Examples. Bootstrap scripts
856
+
857
+ ### basic
858
+
859
+ * change root password
860
+
861
+ ```
862
+ 'provision' => {
863
+
864
+ "bootstrap" => [
865
+
866
+ {
867
+ 'type' => 'shell',
868
+ 'script'=>%Q(bash -c "echo 'root:newpass' | chpasswd")
869
+ },
870
+ ]
871
+ },
872
+
873
+ ```
874
+
875
+ it will run command:
876
+ ```
877
+ docker exec container_name bash -c "sh /tmp/bootstrap.sh"
878
+ ```
879
+
880
+
881
+ ### run script on the host machine
882
+
883
+ * use option `run_from'=>'host'` for bootstrap script
884
+ ```
885
+ 'provision' => {
886
+ "bootstrap" => [
887
+ {
888
+ 'type' => 'shell',
889
+ 'script'=>'do smth...',
890
+ 'run_from'=>'host'
891
+ },
892
+ ]
893
+ },
894
+
895
+ ```
896
+
897
+
898
+ ### additional options for docker exec
899
+
900
+ * run script under another non-root user
901
+
902
+ ```
903
+ 'provision' => {
904
+ "bootstrap" => [
905
+ {
906
+ 'type' => 'shell',
907
+ 'script'=>%Q(bash -c "sh /tmp/bootstrap.sh"),
908
+ 'exec_options'=>'--user app'
909
+ },
910
+ ]
911
+ },
912
+
913
+ ```
914
+
915
+ it will run command:
916
+ ```
917
+ docker exec --user app container_name bash -c "sh /tmp/bootstrap.sh"
918
+ ```
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: docker-app
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Max Ivak
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-07-27 00:00:00.000000000 Z
11
+ date: 2017-08-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -52,7 +52,7 @@ dependencies:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
- description: Install Docker containers with Chef, Dockerfile and other tools
55
+ description: Run Docker containers and provision with Chef, shell and other tools
56
56
  email:
57
57
  - max.ivak@gmail.com
58
58
  executables: