projects
/
discourse_docker.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7d0d783
)
Calculate layers to keep only when necessary
author
Rafael dos Santos Silva
<xfalcox@gmail.com>
Wed, 19 Oct 2016 20:40:29 +0000
(18:40 -0200)
committer
Rafael dos Santos Silva
<xfalcox@gmail.com>
Wed, 19 Oct 2016 20:40:29 +0000
(18:40 -0200)
image/build.rb
patch
|
blob
|
blame
|
history
diff --git
a/image/build.rb
b/image/build.rb
index 30a0420acd77838065f0eafcbdc54783794f6bc7..2860293f60dca4b812709698eadace99530154c6 100644
(file)
--- a/
image/build.rb
+++ b/
image/build.rb
@@
-31,7
+31,7
@@
def build(image, version)
if image[:squash]
- layers_to_squash = run("docker history #{img} | wc -l").first.to_i - (1 + image[:layers_to_keep])
+ layers_to_squash = run("docker history #{img} | wc -l").first.to_i - (1 + image[:layers_to_keep])
if image[:layers_to_keep] != nil
if layers_to_keep != nil
run("docker-squash -t #{image[:tag]} --verbose -f #{layers_to_squash} #{img}")