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