pupy/build-docker.sh

39 lines
821 B
Bash
Raw Normal View History

#!/bin/bash
SELF=`readlink -f "$0"`
PUPY=`dirname "$SELF"`
PUPY=`readlink -f "$PUPY"`
TAG=${TAG:-"latest"}
set -e
2018-03-04 07:03:06 +00:00
DOCKER_REPO=${DOCKER_REPO:-"alxchk"}
if [ ! -z "$REPO" ]; then
if [ "$REPO" == "local" ]; then
2018-03-04 07:03:06 +00:00
REPO="pupy"
else
2018-03-04 07:03:06 +00:00
REPO="$REPO/pupy"
fi
2018-03-04 07:03:06 +00:00
else
REPO="${DOCKER_REPO}/pupy"
fi
echo "[+] Build clients"
${PUPY}/client/build-docker.sh
echo
echo "[+] Build pupysh (${REPO}:${TAG})"
cd ${PUPY}/pupy && docker build -f ${PUPY}/pupy/conf/Dockerfile.default -t ${REPO}:${TAG} .
echo
2018-10-01 19:22:17 +00:00
echo "[+] Build pupysh / compose (${REPO}:${TAG})"
tmpdir=`mktemp -d`
cp ${PUPY}/pupy/requirements.txt ${tmpdir}
mkdir -p ${tmpdir}/external
cp -a ${PUPY}/pupy/external/pykcp ${tmpdir}/external
docker build -f ${PUPY}/pupy/conf/Dockerfile.compose -t ${REPO}:base-${TAG} ${tmpdir}
rm -rf $tmpdir
echo