12
12
usage () {
13
13
cat << EOF
14
14
15
- Usage: buildDockerImage.sh -v [version] [-d | -g | -i] [-s]
15
+ Usage: buildDockerImage.sh -v [version] [-d | -g | -i] [-s] [-c]
16
16
Builds a Docker Image for Oracle WebLogic.
17
17
18
18
Parameters:
@@ -21,6 +21,7 @@ Parameters:
21
21
-d: creates image based on 'developer' distribution
22
22
-g: creates image based on 'generic' distribution
23
23
-i: creates image based on 'infrastructure' distribution
24
+ -c: enables Docker image layer cache during build
24
25
-s: skips the MD5 check of packages
25
26
26
27
* select one distribution only: -d, -g, or -i
@@ -52,7 +53,8 @@ GENERIC=0
52
53
INFRASTRUCTURE=0
53
54
VERSION=" 12.2.1"
54
55
SKIPMD5=0
55
- while getopts " hsdgiv:" optname; do
56
+ NOCACHE=true
57
+ while getopts " hcsdgiv:" optname; do
56
58
case " $optname " in
57
59
" h" )
58
60
usage
@@ -72,6 +74,9 @@ while getopts "hsdgiv:" optname; do
72
74
" v" )
73
75
VERSION=" $OPTARG "
74
76
;;
77
+ " c" )
78
+ NOCACHE=false
79
+ ;;
75
80
* )
76
81
# Should not occur
77
82
echo " Unknown error while processing options inside buildDockerImage.sh"
@@ -136,7 +141,7 @@ echo "Building image '$IMAGE_NAME' ..."
136
141
137
142
# BUILD THE IMAGE (replace all environment variables)
138
143
BUILD_START=$( date ' +%s' )
139
- docker build --force-rm=true --no-cache=true $PROXY_SETTINGS -t $IMAGE_NAME -f Dockerfile.$DISTRIBUTION . || {
144
+ docker build --force-rm=$NOCACHE --no-cache=$NOCACHE $PROXY_SETTINGS -t $IMAGE_NAME -f Dockerfile.$DISTRIBUTION . || {
140
145
echo " There was an error building the image."
141
146
exit 1
142
147
}
0 commit comments