docker: ajout run

This commit is contained in:
Jephté Clain 2018-06-02 19:52:40 +04:00
parent 75385a76bf
commit 04e37db5cb
2 changed files with 13 additions and 3 deletions

View File

@ -3,7 +3,10 @@ FROM d9base
ARG date
ARG version
LABEL name=d9-nutools date=$date version=$version
COPY . /install/nutools
RUN /install/nutools/uinst -y /install/nutools && rm -rf /install/nutools
ENV I=/install/nutools
COPY . $I
RUN $I/uinst -y $I && rm -rf $I
ENV PATH="$PATH:/usr/local/nutools"
CMD ["/bin/bash", "-il"]

View File

@ -16,18 +16,21 @@ USAGE
OPTIONS
-b, --build
-n, --no-cache"
-n, --no-cache
-r, --run"
}
auto=1
prereqs=
build=
no_cache=
run=
args=(
--help '$exit_with display_help'
--prereqs '$prereqs=1; auto='
-b,--build '$build=1; auto='
-n,--no-cache no_cache=1
-r,--run '$run=1; auto='
)
parse_args "$@"; set -- "${args[@]}"
@ -50,3 +53,7 @@ if [ -n "$build" ]; then
docker build "${args[@]}" "$ENVDIR"
eend
fi
if [ -n "$run" ]; then
docker run -it --rm "$NAME"
fi