dockerfilemerge 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +4 -3
- data/lib/dockerfilemerge.rb +16 -2
- data.tar.gz.sig +0 -0
- metadata +2 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8474a3015f025764310d703e159bdcc2d4b7b539
|
4
|
+
data.tar.gz: f67fbda4f8f08ccbc19bdacf7e291fd89b134be9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 091494c67bb938bee16fbcb79200361a05d6613e11b744b91022ee9d9b85c378a4475e3a7d38ef0be84d6f525e19eecc3cc4143fcf9c4da0d6161ea25202608a
|
7
|
+
data.tar.gz: 8fd281a8f9165c7b19268a5c0534da0c96dd7c9474ce71be1e077b9b5b5bab921bbe92e06de91e0c50346bb4f76f0ec9bd2d10b94b3a122aec2de1df92290c65
|
checksums.yaml.gz.sig
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
1
|
+
J�#�4����
|
2
|
+
Z_;~_��|�l������8(�v�S��6K�m!�_Py����,�y�Li��!�7�Y N��)��Vt���؊D,��s`�H)IlO�����/͐F r+Q�9M���b�֙6���)Ğa6�_9_��w����-~ܔ�)��K�e�����
|
3
|
+
9��}��虓+�[��z�R�A����vp��fm���qM�;ەf�:�?��Y�F�x皌�:�2�U��w
|
4
|
+
\�|v� �8�eQ�d
|
data/lib/dockerfilemerge.rb
CHANGED
@@ -64,6 +64,8 @@ class DockerfileMerge
|
|
64
64
|
maintainers.each {|x| lines.delete x}
|
65
65
|
|
66
66
|
when :run
|
67
|
+
|
68
|
+
# find the last run command and add the present run command after it
|
67
69
|
|
68
70
|
i = lines.index lines.grep(/RUN/).last
|
69
71
|
i+=1 while lines[i][/\\\s*$/]
|
@@ -96,8 +98,16 @@ class DockerfileMerge
|
|
96
98
|
|
97
99
|
singlify_first lines, /^\s*FROM /
|
98
100
|
singlify_last lines, /^\s*CMD /
|
101
|
+
s = lines.join("\n")
|
99
102
|
|
100
|
-
|
103
|
+
rm_sources = /rm -rf \/var\/lib\/apt\/lists\/\*/
|
104
|
+
rm_sources_count = s.scan(rm_sources).length
|
105
|
+
|
106
|
+
if rm_sources_count > 1 then
|
107
|
+
(rm_sources_count - 1).times { remove_command(rm_sources,s) }
|
108
|
+
end
|
109
|
+
|
110
|
+
@to_s = s
|
101
111
|
end
|
102
112
|
|
103
113
|
private
|
@@ -117,7 +127,11 @@ class DockerfileMerge
|
|
117
127
|
rows.grep(/^# Pull /).each {|x| rows.delete x}
|
118
128
|
|
119
129
|
lines.concat rows
|
120
|
-
end
|
130
|
+
end
|
131
|
+
|
132
|
+
def remove_command(regex, s)
|
133
|
+
s.sub!(/(?:RUN\s+|\\?\s*&&\s+||&&\s*\\\s*)?#{regex}(?:\s+\\)? */,'')
|
134
|
+
end
|
121
135
|
|
122
136
|
# removes any matching lines after the 1st matching line
|
123
137
|
#
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dockerfilemerge
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -31,7 +31,7 @@ cert_chain:
|
|
31
31
|
WHpJ21HYl4KWG8TISerrdwpQAZ5dhV2Yy/4q0MWSnDcMRSYdRAixOcdYW+U+R8cz
|
32
32
|
pf2JrQZNdYZXIg==
|
33
33
|
-----END CERTIFICATE-----
|
34
|
-
date: 2015-
|
34
|
+
date: 2015-08-02 00:00:00.000000000 Z
|
35
35
|
dependencies:
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: lineparser
|
metadata.gz.sig
CHANGED
Binary file
|