Blame docker-builder/run.sh

1b5f3d
#!/bin/bash
1b5f3d
e7b20d
OLDDIR=`pwd`
e7b20d
SCRIPT_DIR=$(cd `dirname "$0"`; pwd)
e7b20d
cd "$OLDDIR"
1b5f3d
BASE_DIR=`dirname "$SCRIPT_DIR"`
1b5f3d
DATA_DIR="$BASE_DIR/docker-builder-data"
1b5f3d
1b5f3d
BUILD_DIR=$DATA_DIR/build
1b5f3d
e14835
docker stop "builder" || true
e14835
docker rm "builder" || true
1b5f3d
dd482a
CONFIG_FILE="$BASE_DIR/config.sh"
dd482a
PACKET_BUILD_DIR="$BUILD_DIR/packet"
dd482a
SCRIPT_BUILD_DIR="$BUILD_DIR/script"
dd482a
if [ -f $CONFIG_FILE ]; then
dd482a
	source $CONFIG_FILE
dd482a
fi
dd482a
export PACKET_BUILD_DIR
dd482a
mkdir -p $PACKET_BUILD_DIR
dd482a
e14835
docker run -it \
1b5f3d
    --name "builder" \
b0fa99
    --privileged=true \
95dbc1
    $DOCKER_RUN_OPTIONS \
dd482a
    -v "$PACKET_BUILD_DIR:/build/packet" \
dd482a
    -v "$SCRIPT_BUILD_DIR:/build/script" \
e14835
    my/builder \
e14835
    /build/script/common/manager.sh "$@"
1b5f3d