#!/bin/bash
server=hubreg.algometic.com
docker images --format {{.Repository}}:{{.Tag}} |&
while read -p first second; do
   if [[ $1 == "noexec" ]]
   then
       echo docker tag $second $server/$second
       echo docker push $server/$second 
   elif [[ $1 == "push" ]] 
   then
       docker tag $second $server/$second
       docker push $server/$second 
   else
       echo "Usage: docker_push_all.sh {noexec|push}"
       break 
   fi       
done

