diff --git a/Dockerfile.development b/Dockerfile.development index 646ff6f5ef4..09d117a2e99 100644 --- a/Dockerfile.development +++ b/Dockerfile.development @@ -36,15 +36,18 @@ COPY --chown=dependabot:dependabot nuget/Gemfile nuget/dependabot-nuget.gemspec COPY --chown=dependabot:dependabot python/Gemfile python/dependabot-python.gemspec ${CODE_DIR}/python/ COPY --chown=dependabot:dependabot pub/Gemfile pub/dependabot-pub.gemspec ${CODE_DIR}/pub/ COPY --chown=dependabot:dependabot terraform/Gemfile terraform/dependabot-terraform.gemspec ${CODE_DIR}/terraform/ +ARG TARGET_ECOSYSTEM= RUN GREEN='\033[0;32m'; NC='\033[0m'; \ for d in `find ${CODE_DIR} -type f -mindepth 2 -maxdepth 2 \ -not -path "${CODE_DIR}/common/Gemfile" \ -name 'Gemfile' | xargs dirname`; do \ - echo && \ - echo "---------------------------------------------------------------------------" && \ - echo "Installing gems for ${GREEN}$(realpath --relative-to=${CODE_DIR} $d)${NC}..." && \ - echo "---------------------------------------------------------------------------" && \ - cd $d && bundle install; \ + if [ -z "$TARGET_ECOSYSTEM" ] || [ "$d" = "${CODE_DIR}/$TARGET_ECOSYSTEM" ]; then \ + echo && \ + echo "---------------------------------------------------------------------------" && \ + echo "Installing gems for ${GREEN}$(realpath --relative-to=${CODE_DIR} $d)${NC}..." && \ + echo "---------------------------------------------------------------------------" && \ + cd $d && bundle install; \ + fi; \ done COPY --chown=dependabot:dependabot omnibus/Gemfile omnibus/dependabot-omnibus.gemspec ${CODE_DIR}/omnibus/ diff --git a/bin/docker-dev-shell b/bin/docker-dev-shell index c12c29a30a6..d202dc45607 100755 --- a/bin/docker-dev-shell +++ b/bin/docker-dev-shell @@ -53,7 +53,11 @@ build_image() { --cache-from "dependabot/dependabot-core:latest" \ -t dependabot/dependabot-core . echo "$(tput setaf 2)=> building image from $DOCKERFILE$(tput sgr0)" - docker build --build-arg BUILDKIT_INLINE_CACHE=1 -t "$IMAGE_NAME" -f "$DOCKERFILE" . + docker build \ + --build-arg BUILDKIT_INLINE_CACHE=1 \ + --build-arg "TARGET_ECOSYSTEM=${TARGET_ECOSYSTEM}" \ + -t "$IMAGE_NAME" \ + -f "$DOCKERFILE" . } IMAGE_ID=$(docker inspect --type=image -f '{{.Id}}' "$IMAGE_NAME" 2> /dev/null || true)