diff --git a/config.sh.blank b/config.sh.blank index 5b9c145..8c78c9e 100644 --- a/config.sh.blank +++ b/config.sh.blank @@ -1 +1,4 @@ -# PACKET_BUILD_DIR=/data/builder \ No newline at end of file +# PACKET_BUILD_DIR=/data/builder +# PROXY=http://1.2.3.4:1234 +# DOCKER_BUILD_OPTIONS="--build-arg=http_proxy=$PROXY --build-arg=https_proxy=$PROXY" +# DOCKER_RUN_OPTIONS="-e http_proxy=$PROXY -e https_proxy=$PROXY" diff --git a/docker-builder-i386/build.sh b/docker-builder-i386/build.sh index 1fb5dee..8d92e21 100755 --- a/docker-builder-i386/build.sh +++ b/docker-builder-i386/build.sh @@ -3,4 +3,4 @@ SCRIPT_FILE=`realpath "$0"` SCRIPT_DIR=`dirname "$SCRIPT_FILE"` -docker build -t my/builder-i386 "$SCRIPT_DIR" +docker build -t my/builder-i386 $DOCKER_BUILD_OPTIONS "$SCRIPT_DIR" diff --git a/docker-builder-i386/run.sh b/docker-builder-i386/run.sh index 018f895..0e2e135 100755 --- a/docker-builder-i386/run.sh +++ b/docker-builder-i386/run.sh @@ -21,6 +21,7 @@ mkdir -p $PACKET_BUILD_DIR docker run -it \ --name "builder-i386" \ + $DOCKER_RUN_OPTIONS \ -v "$PACKET_BUILD_DIR:/build/packet" \ -v "$SCRIPT_BUILD_DIR:/build/script" \ -e PLATFORM=linux-i386 \ diff --git a/docker-builder/build.sh b/docker-builder/build.sh index c108b43..09e245a 100755 --- a/docker-builder/build.sh +++ b/docker-builder/build.sh @@ -2,5 +2,16 @@ SCRIPT_FILE=`realpath "$0"` SCRIPT_DIR=`dirname "$SCRIPT_FILE"` +BASE_DIR=`dirname "$SCRIPT_DIR"` -docker build -t my/builder "$SCRIPT_DIR" +CONFIG_FILE="$BASE_DIR/config.sh" +PACKET_BUILD_DIR="$BUILD_DIR/packet" +SCRIPT_BUILD_DIR="$BUILD_DIR/script" +if [ -f $CONFIG_FILE ]; then + source $CONFIG_FILE +fi +export PACKET_BUILD_DIR +mkdir -p $PACKET_BUILD_DIR + + +docker build -t my/builder $DOCKER_BUILD_OPTIONS "$SCRIPT_DIR" diff --git a/docker-builder/run.sh b/docker-builder/run.sh index 64c5f17..1333de6 100755 --- a/docker-builder/run.sh +++ b/docker-builder/run.sh @@ -21,6 +21,7 @@ mkdir -p $PACKET_BUILD_DIR docker run -it \ --name "builder" \ + $DOCKER_RUN_OPTIONS \ -v "$PACKET_BUILD_DIR:/build/packet" \ -v "$SCRIPT_BUILD_DIR:/build/script" \ my/builder \