File tree Expand file tree Collapse file tree 1 file changed +32
-9
lines changed Expand file tree Collapse file tree 1 file changed +32
-9
lines changed Original file line number Diff line number Diff line change @@ -18,20 +18,43 @@ fatal() {
18
18
exit 1
19
19
}
20
20
21
- for DOCKERFILE in $DOCKERFILES ; do
22
- TAG=$( echo $DOCKERFILE | sed ' s/Dockerfile//g' )
23
- info " =========="
24
- info " Building $TAG ..."
25
- docker build -q $TAG
21
+ cd $( cd ${0%/* } && pwd -P) ;
22
+
23
+ versions=( " $@ " )
24
+ if [ ${# versions[@]} -eq 0 ]; then
25
+ versions=( * / )
26
+ fi
27
+ versions=( " ${versions[@]%/ } " )
28
+
29
+ for version in " ${versions[@]} " ; do
30
+
31
+ tag=$( cat $version /Dockerfile | grep " ENV NODE_VERSION" | cut -d' ' -f3)
32
+
33
+ info " Building $tag ..."
34
+ docker build -q -t node:$tag $version
35
+
26
36
if [[ $? -gt 0 ]]; then
27
- fatal " Build of $TAG failed!"
37
+ fatal " Build of $tag failed!"
28
38
else
29
- info " Build of $TAG succeeded"
39
+ info " Build of $tag succeeded. "
30
40
fi
41
+
42
+ variants=( onbuild slim wheezy )
43
+
44
+ for variant in " ${variants[@]} " ; do
45
+ info " Building $tag -$variant variant..."
46
+ docker build -q -t node:$tag -$variant $version /$variant
47
+
48
+ if [[ $? -gt 0 ]]; then
49
+ fatal " Build of $tag -$variant failed!"
50
+ else
51
+ info " Build of $tag -$variant succeeded."
52
+ fi
53
+
54
+ done
55
+
31
56
done
32
57
33
58
info " All builds successful!"
34
- info " Dockerfiles:"
35
- info " $DOCKERFILES "
36
59
37
60
exit 0
You can’t perform that action at this time.
0 commit comments