Skip to content

Commit 90cd58e

Browse files
committed
comments
1 parent cf4b127 commit 90cd58e

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

bin/dbstack

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
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
1011
APP_DEFAULT_CONFIG_FILE=containers.env
@@ -17,7 +18,7 @@ WORKER_SERVICE=worker
1718
APP_LOCAL_CONFIG_FILE=
1819
AS_ROOT=false
1920
BOOTSTRAP_TIMEOUT=300
20-
CLEANUP_IMAGES=false
21+
CLEANUP_UNUSED_IMAGES=false
2122
DOCKER_NO_CACHE=
2223
PARALLEL_BUILD=
2324
PULL_IMAGES=false
@@ -127,9 +128,9 @@ setup_local_config() {
127128
}
128129

129130
build() {
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
305306
do
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

Comments
 (0)