From d8c3285e3cac3dfd0a707a25b7d2dbdc43a1ceae Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Sat, 19 Aug 2023 02:51:00 -0400 Subject: [PATCH] Add --init flag to docker run. I noticed in a separate project that ctrl+c was not being honored under --init was passed, so I'm adding it in here. --- Makefile | 2 +- scripts/run_docker_compare.bash | 2 +- scripts/run_docker_integration_test.bash | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 70cb4fb7..a1337a54 100644 --- a/Makefile +++ b/Makefile @@ -40,7 +40,7 @@ test: .PHONY: dockertest dockertest: > $(MAKE) -C docker/organic_test -> docker run --rm -i -t -v "$$(readlink -f ./):/source:ro" --mount source=cargo-cache,target=/usr/local/cargo/registry --mount source=rust-cache,target=/target --env CARGO_TARGET_DIR=/target -w /source organic-test cargo test --no-fail-fast --lib --test test_loader -- --test-threads $(TESTJOBS) +> docker run --init --rm -i -t -v "$$(readlink -f ./):/source:ro" --mount source=cargo-cache,target=/usr/local/cargo/registry --mount source=rust-cache,target=/target --env CARGO_TARGET_DIR=/target -w /source organic-test cargo test --no-fail-fast --lib --test test_loader -- --test-threads $(TESTJOBS) .PHONY: dockerclean dockerclean: diff --git a/scripts/run_docker_compare.bash b/scripts/run_docker_compare.bash index ace3efa4..8fc4b74a 100755 --- a/scripts/run_docker_compare.bash +++ b/scripts/run_docker_compare.bash @@ -40,7 +40,7 @@ function launch_container { additional_flags+=(--env RUST_BACKTRACE=full) fi - docker run "${additional_flags[@]}" --rm -i -v "$($REALPATH ./):/source:ro" --mount source=cargo-cache,target=/usr/local/cargo/registry --mount source=rust-cache,target=/target --env CARGO_TARGET_DIR=/target -w /source organic-test "${additional_args[@]}" + docker run "${additional_flags[@]}" --init --rm -i -v "$($REALPATH ./):/source:ro" --mount source=cargo-cache,target=/usr/local/cargo/registry --mount source=rust-cache,target=/target --env CARGO_TARGET_DIR=/target -w /source organic-test "${additional_args[@]}" } main "${@}" diff --git a/scripts/run_docker_integration_test.bash b/scripts/run_docker_integration_test.bash index 0f66eae7..b1bb8cf7 100755 --- a/scripts/run_docker_integration_test.bash +++ b/scripts/run_docker_integration_test.bash @@ -50,7 +50,7 @@ cargo test --no-fail-fast --lib --test test_loader "$test" -- --show-output EOF ) - docker run --rm -v "$($REALPATH ./):/source:ro" --mount source=cargo-cache,target=/usr/local/cargo/registry --mount source=rust-cache,target=/target --env CARGO_TARGET_DIR=/target -w /source organic-test sh -c "$init_script" + docker run --init --rm -v "$($REALPATH ./):/source:ro" --mount source=cargo-cache,target=/usr/local/cargo/registry --mount source=rust-cache,target=/target --env CARGO_TARGET_DIR=/target -w /source organic-test sh -c "$init_script" }