2 ##############################################################################
3 # Copyright (c) 2015 Ericsson AB and others.
4 # stefan.k.berg@ericsson.com
5 # jonas.bjurel@ericsson.com
6 # All rights reserved. This program and the accompanying materials
7 # are made available under the terms of the Apache License, Version 2.0
8 # which accompanies this distribution, and is available at
9 # http://www.apache.org/licenses/LICENSE-2.0
10 ##############################################################################
16 res=`docker build -q --rm - <<EOF
19 RUN /root/setcontext $USER $UID $GID $HOME
21 GITROOT=`git rev-parse --show-toplevel`
22 CID=`echo $res | sed 's/.* //'`
24 RUN_CONTEXT_OPT="--privileged=true --rm -i -e HOME=$HOME -u $USER -w $PWD -v ${HOME}/.ssh:${HOME}/.ssh -v $GITROOT:$GITROOT"
26 if [ "${INTERACTIVE}" != "FALSE" ]; then
27 RUN_CONTEXT_OPT+=" -t"
30 echo command: docker run ${RUN_CONTEXT_OPT} $CID "$@"
31 docker run ${RUN_CONTEXT_OPT} $CID "$@"
34 docker rmi -f $CID > /dev/null