From ba4a57223765e528a03540fbf12293c54afa8dc2 Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Tue, 27 Jul 2021 06:36:38 -0400 Subject: [PATCH] Docker: Use rsync instead of timeout to exclude npm directories --- docker/build_docker.sh | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/docker/build_docker.sh b/docker/build_docker.sh index bd37c3fee..797e8d06d 100755 --- a/docker/build_docker.sh +++ b/docker/build_docker.sh @@ -135,15 +135,20 @@ copy_entrypoint_to_build_dir() { cp ./entrypoint.sh "$BUILD_DIR" chmod 755 "$BUILD_DIR/entrypoint.sh" } + copy_monkey_island_to_build_dir() { local src=$1 + cp "$src"/__init__.py "$BUILD_DIR" cp "$src"/monkey_island.py "$BUILD_DIR" - cp -r "$src"/common "$BUILD_DIR/" - if ! timeout "${ISLAND_DIR_COPY_TIMEOUT}" cp -r "$src"/monkey_island "$BUILD_DIR/"; then - log_message "Copying island files takes too long. Maybe you're copying a dev folder instead of a fresh repository?" - exit 1 - fi + cp -v -r "$src"/common "$BUILD_DIR/" + + rsync \ + -avr \ + --exclude=monkey_island/cc/ui/node_modules \ + --exclude=monkey_island/cc/ui/.npm \ + "$src"/monkey_island "$BUILD_DIR/" + cp ./server_config.json "$BUILD_DIR"/monkey_island/cc/ }