From 42fd2dcd6c791c173b6f5ce20222ee051b21841e Mon Sep 17 00:00:00 2001 From: root Date: Thu, 22 Feb 2024 10:26:52 +0100 Subject: [PATCH] removed error print when running run.sh in docker container --- README.md | 3 +-- scripts/run.sh | 7 ++++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index a0deab2..bc8a35d 100644 --- a/README.md +++ b/README.md @@ -140,8 +140,7 @@ For more details, we refer to the paper. TODO: add paper link here - ``docker cp : `` (copy whole folder or individual files), e.g., ``docker cp e7ba94d69e94:/app/res ./docker`` - to get container_id call ``docker ps`` -> Note that the Dockerfile uses multiple stages. The first stage builds the executable using rust/cargo and the second stage uses a debian environment to execute it. Therefore, there are no cargo-commands available in the container while running. Line 7 in run.sh will fail, but since it is prebuilded during the build stage, the consecutive commands will work. - +> The Dockerfile uses multiple stages. The first stage builds the executable using rust/cargo and the second stage uses a debian environment to execute it. Therefore, there are no cargo-commands available in the container while running. ## How to Interpret the Output Format Running e.g. `cargo run --release -- -l -c -s -f //TBT-Segmentation/res/logs_wind_front_Lateral/` produces an output that contains the following lines: diff --git a/scripts/run.sh b/scripts/run.sh index d73896b..3f2c18e 100644 --- a/scripts/run.sh +++ b/scripts/run.sh @@ -4,7 +4,12 @@ #!/bin/bash # Build the Rust project -cargo build --release +if grep -q docker /proc/1/cgroup; then + echo "Running inside a Docker container." +else + echo "Not running inside a Docker container." + cargo build --release +fi # Define variables previous_pwd="$(pwd)"