mirror of https://github.com/n1nj4sec/pupy.git
build-docker: make docker command configurable via env
This commit is contained in:
parent
197701ef7b
commit
45c4f61c0d
|
@ -4,6 +4,7 @@ SELF=`readlink -f "$0"`
|
||||||
PUPY=`dirname "$SELF"`/../
|
PUPY=`dirname "$SELF"`/../
|
||||||
PUPY=`readlink -f "$PUPY"`
|
PUPY=`readlink -f "$PUPY"`
|
||||||
|
|
||||||
|
DOCKER_COMMAND=${DOCKER_COMMAND:-docker}
|
||||||
DOCKER_REPO=${DOCKER_REPO:-"alxchk"}
|
DOCKER_REPO=${DOCKER_REPO:-"alxchk"}
|
||||||
CLEAN=${CLEAN:-"no"}
|
CLEAN=${CLEAN:-"no"}
|
||||||
|
|
||||||
|
@ -31,17 +32,17 @@ start_container() {
|
||||||
echo
|
echo
|
||||||
echo "[+] Build $SOURCES with toolchain ${REPO}$TOOLCHAIN"
|
echo "[+] Build $SOURCES with toolchain ${REPO}$TOOLCHAIN"
|
||||||
NEW=""
|
NEW=""
|
||||||
docker container inspect ${CONTAINER_NAME} >/dev/null 2>/dev/null || NEW=1
|
${DOCKER_COMMAND} container inspect ${CONTAINER_NAME} >/dev/null 2>/dev/null || NEW=1
|
||||||
if [ ! -z "$NEW" ]; then
|
if [ ! -z "$NEW" ]; then
|
||||||
mkdir -p /tmp/pupy-build/${REPO}${TOOLCHAIN}
|
mkdir -p /tmp/pupy-build/${REPO}${TOOLCHAIN}
|
||||||
docker run --name ${CONTAINER_NAME} \
|
${DOCKER_COMMAND} run --name ${CONTAINER_NAME} \
|
||||||
-v ${PUPY}:/build/workspace/project ${REPO}${TOOLCHAIN} ${SCRIPT}
|
-v ${PUPY}:/build/workspace/project ${REPO}${TOOLCHAIN} ${SCRIPT}
|
||||||
else
|
else
|
||||||
docker start -ai ${CONTAINER_NAME}
|
${DOCKER_COMMAND} start -ai ${CONTAINER_NAME}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$CLEAN" == "yes" ]; then
|
if [ "$CLEAN" == "yes" ]; then
|
||||||
docker rm ${CONTAINER_NAME}
|
${DOCKER_COMMAND} rm ${CONTAINER_NAME}
|
||||||
fi
|
fi
|
||||||
echo
|
echo
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue