pupy/build-docker.sh

40 lines
863 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
cp ${PUPY}/pupy/conf/Dockerfile.compose ${tmpdir}
docker build -f ${tmpdir}/Dockerfile.compose -t ${REPO}:base-${TAG} ${tmpdir}
2018-10-01 19:22:17 +00:00
rm -rf $tmpdir
echo