From 6b0a689adb72a03f0c63329e504747e38ae4dd7d Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Tue, 19 Oct 2021 11:02:50 -0400 Subject: [PATCH] Docker: Fix `git rev-parse` command Add -C to git command in order to execute rev-parse outside the repo. --- build_scripts/docker/docker.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build_scripts/docker/docker.sh b/build_scripts/docker/docker.sh index af719fb0d..519cc54d0 100755 --- a/build_scripts/docker/docker.sh +++ b/build_scripts/docker/docker.sh @@ -15,7 +15,7 @@ setup_build_dir() { copy_entrypoint_to_build_dir "$build_dir" - build_commit=$(git rev-parse --git-dir "$monkey_repo" --short HEAD) + build_commit=$(git -C "$monkey_repo" rev-parse --short HEAD) copy_monkey_island_to_build_dir "$monkey_repo/monkey" "$build_dir" copy_server_config_to_build_dir "$build_dir" @@ -44,7 +44,7 @@ build_package() { if [ -n "$1" ]; then version="v$version" else - version="v$build_commit" + version="$build_commit" fi docker_image_name="guardicore/monkey-island:$version"