blob: 873c09da8968edb87e59384a5eecb0c22504ced7 [file] [log] [blame]
#!/bin/bash
MY_PATH="`dirname \"$0\"`" # relative
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
if [ -z "$MY_PATH" ] ; then
# error; for some reason, the path is not accessible
# to the script (e.g. permissions re-evaled after suid)
exit 1 # fail
fi
WORKING_DIR=$2
if [ -z "$WORKING_DIR" ]; then
WORKING_DIR="$(pwd)"
fi
docker run -it --rm -e UID=$(id -u) -u $(id -u):$(id -g) -v $WORKING_DIR:/home/user -w /home/user -e USERNAME=$USERNAME -e USER=$USER -e USERID=$UID $1:latest /bin/bash