Make image name overrideable
This commit is contained in:
parent
82783114fb
commit
1c197db45b
@ -12,17 +12,19 @@ popd() { command popd "$@" > /dev/null; }
|
||||
here="$(pwd)"
|
||||
script_dir="$(dirname "$(readlink -f "$0")")"
|
||||
|
||||
IMAGE="${IMAGE:-debian-here}"
|
||||
|
||||
|
||||
run() {
|
||||
if [[ ! -z "${BUILD:-}" ]];then
|
||||
pushd "$script_dir"
|
||||
docker build -t debian-here .
|
||||
docker build -t "$IMAGE" .
|
||||
popd
|
||||
exit
|
||||
fi
|
||||
|
||||
mount_point="/mnt/$(basename "$here")"
|
||||
docker run --rm -ti -v "$here":"$mount_point" -w "$mount_point" ${ARGS:-} debian-here "$@"
|
||||
docker run --rm -ti -v "$here":"$mount_point" -w "$mount_point" ${ARGS:-} "$IMAGE" "$@"
|
||||
}
|
||||
|
||||
run "$@"
|
||||
|
Loading…
Reference in New Issue
Block a user