33# Shortcuts to manage the whole set of containers
44
55# @todo allow end user to enter pwd for root db accounts on build. If not interactive, generate a random one
6- # @todo check for ports conflicts before starting thwe web container
6+ # @todo check for ports conflicts before starting the web container
77# @todo if there's no docker-compose onboard but there is curl or wget, download and install docker-compose
8+ # @todo add a command to remove the built containers and their anon volumes ? eg. `docker-compose rm -s -v`
89
910# consts
1011APP_DEFAULT_CONFIG_FILE=containers.env
@@ -17,7 +18,7 @@ WORKER_SERVICE=worker
1718APP_LOCAL_CONFIG_FILE=
1819AS_ROOT=false
1920BOOTSTRAP_TIMEOUT=300
20- CLEANUP_IMAGES =false
21+ CLEANUP_UNUSED_IMAGES =false
2122DOCKER_NO_CACHE=
2223PARALLEL_BUILD=
2324PULL_IMAGES=false
@@ -127,9 +128,9 @@ setup_local_config() {
127128}
128129
129130build () {
130- if [ ${CLEANUP_IMAGES } = ' true' ]; then
131+ if [ ${CLEANUP_UNUSED_IMAGES } = ' true' ]; then
131132 # for good measure, do a bit of hdd disk cleanup ;-)
132- echo " [` date` ] Removing dead Docker images from disk..."
133+ echo " [` date` ] Removing unused Docker images from disk..."
133134 docker rmi $( docker images | grep " <none>" | awk " {print \$ 3}" )
134135 fi
135136
@@ -165,8 +166,8 @@ build() {
165166 wait_for_bootstrap app
166167 fi
167168
168- if [ ${CLEANUP_IMAGES } = ' true' ]; then
169- echo " [` date` ] Removing dead Docker images from disk, again..."
169+ if [ ${CLEANUP_UNUSED_IMAGES } = ' true' ]; then
170+ echo " [` date` ] Removing unused Docker images from disk, again..."
170171 docker rmi $( docker images | grep " <none>" | awk " {print \$ 3}" )
171172 fi
172173
@@ -305,7 +306,7 @@ while getopts ":chnprsuvw:z" opt
305306do
306307 case $opt in
307308 c)
308- CLEANUP_IMAGES =true
309+ CLEANUP_UNUSED_IMAGES =true
309310 ;;
310311 h)
311312 help
@@ -448,6 +449,7 @@ case "${COMMAND}" in
448449 docker-compose ${VERBOSITY} unpause ${2}
449450 ;;
450451
452+ # achieved by running `build -u`... could be expanded to also do a git pull?
451453 # update)
452454 # ;;
453455
0 commit comments