comparison docker/libervia_cont.sh @ 28:9ca1e7fe0f87

Docker: we update images, not containers
author Goffi <goffi@goffi.org>
date Mon, 20 Oct 2014 18:16:27 +0200
parents a5e4c6c2a37d
children f5067e3112ba
comparison
equal deleted inserted replaced
27:b2a09608bd9b 28:9ca1e7fe0f87
252 docker rm $CONT > /dev/null 2>&1 || printf "... Error while removing $CONT\n" 252 docker rm $CONT > /dev/null 2>&1 || printf "... Error while removing $CONT\n"
253 done 253 done
254 printf "\n" 254 printf "\n"
255 ;; 255 ;;
256 UPDATE) 256 UPDATE)
257 printf "updating containers...\n" 257 printf "updating images...\n"
258 errors=0 258 errors=0
259 for CONT in $CONTAINERS data; do 259 for CONT in $CONTAINERS data; do
260 printf "\n*** updating $CONT ***\n" 260 printf "\n*** updating $CONT ***\n"
261 docker pull $ACCOUNT/$CONT:latest 261 docker pull $ACCOUNT/$CONT:latest
262 if [ $? -ne 0 ]; then 262 if [ $? -ne 0 ]; then
263 printf "\nError while updating $ACCOUNT/$CONT\n" 263 printf "\nError while updating $ACCOUNT/$CONT\n"
264 errors=1 264 errors=1
265 fi 265 fi
266 done 266 done
267 if [ $errors -eq 0 ]; then 267 if [ $errors -eq 0 ]; then
268 printf "\n\nContainers are up-to-date\n" 268 printf "\n\nImages are up-to-date\n"
269 else 269 else
270 printf "\n\nSome errors happened while updating containers\n" 270 printf "\n\nSome errors happened while updating images\n"
271 exit 1 271 exit 1
272 fi 272 fi
273 ;; 273 ;;
274 BACKUP) 274 BACKUP)
275 filename="sat_data_backup_$(date '+%Y-%m-%d_%H:%M:%S').tar.gz" 275 filename="sat_data_backup_$(date '+%Y-%m-%d_%H:%M:%S').tar.gz"