#!/bin/bash set -e ############################################################################## # Copyright (c) 2015 Ericsson AB and others. # stefan.k.berg@ericsson.com # jonas.bjurel@ericsson.com # All rights reserved. This program and the accompanying materials # are made available under the terms of the Apache License, Version 2.0 # which accompanies this distribution, and is available at # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## # ############################################################################ # BEGIN of Exit handlers # do_exit () { CID=`cat $CID_FILE` rm -f $CID_FILE set +e docker kill $CID > /dev/null 2>&1 docker rm -f $CID > /dev/null 2>&1 docker rmi -f $IID > /dev/null 2>&1 set -e } # # End of Exit handlers ############################################################################ trap do_exit SIGINT SIGTERM EXIT context=$1 shift GID=`id -g` USER=`whoami` res=`docker build -q --force-rm - <