Skip to content

Commit

Permalink
Merge pull request #1397 from dependabot/dev-shell-options
Browse files Browse the repository at this point in the history
Allow a few options to be provided to the dev shell
  • Loading branch information
hmarr authored Sep 20, 2019
2 parents 6f01b31 + 921bd7d commit ca0b4b9
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion bin/docker-dev-shell
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -e

IMAGE_NAME="dependabot/dependabot-core-development"
IMAGE_NAME="${IMAGE_NAME:=dependabot/dependabot-core-development}"
DOCKERFILE="Dockerfile.development"
HELP=false
REBUILD=false
Expand Down Expand Up @@ -43,6 +43,20 @@ else
echo "$(tput setaf 4) > image $IMAGE_NAME already exists$(tput sgr0)"
fi

DOCKER_OPTS=()
if [ -n "$HTTP_PROXY" ]; then
DOCKER_OPTS+=(-e "http_proxy=$HTTP_PROXY")
DOCKER_OPTS+=(-e "HTTP_PROXY=$HTTP_PROXY")
fi
if [ -n "$HTTPS_PROXY" ]; then
DOCKER_OPTS+=(-e "https_proxy=$HTTPS_PROXY")
DOCKER_OPTS+=(-e "HTTPS_PROXY=$HTTPS_PROXY")
fi

if [ -n "$DOCKER_NETWORK" ]; then
DOCKER_OPTS+=(--network "$DOCKER_NETWORK")
fi

CONTAINER_ARGS=("bash")
if [ "$#" -gt "0" ]; then
CONTAINER_ARGS=("$@")
Expand Down Expand Up @@ -126,5 +140,6 @@ docker run --rm -ti \
-v "$(pwd)/omnibus/dependabot-omnibus.gemspec:$CODE_DIR/omnibus/dependabot-omnibus.gemspec" \
-v "$(pwd)/omnibus/lib:$CODE_DIR/omnibus/lib" \
-v "$(pwd)/omnibus/spec:$CODE_DIR/omnibus/spec" \
"${DOCKER_OPTS[@]}" \
--cap-add=SYS_PTRACE \
"$IMAGE_NAME" "${CONTAINER_ARGS[@]}"

0 comments on commit ca0b4b9

Please sign in to comment.