#!/bin/sh op=`basename $0 .sh` for context in $*; do if [ "$op" == "build" ]; then extra=" -t $context:latest" else extra=":latest" fi docker $op $context$extra done