From 2809ff464ac80893a4b89fe5861f488bfa75abc5 Mon Sep 17 00:00:00 2001 From: Joe Testa Date: Tue, 12 Sep 2023 08:38:07 -0400 Subject: [PATCH] Added --rm to docker run commands so stopped containers are automatically removed. --- docker_test.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docker_test.sh b/docker_test.sh index 68a2d62..a8c62c1 100755 --- a/docker_test.sh +++ b/docker_test.sh @@ -456,9 +456,9 @@ run_test() { test_name="TinySSH ${version} ${test_number}" fi - cid=$(docker run -d -p 2222:22 "${IMAGE_NAME}:${IMAGE_VERSION}" ${server_exec}) + #echo "Running: docker run --rm -d -p 2222:22 $IMAGE_NAME:$IMAGE_VERSION ${server_exec}" + cid=$(docker run --rm -d -p 2222:22 "${IMAGE_NAME}:${IMAGE_VERSION}" ${server_exec}) retval=$? - #echo "Running: docker run -d -p 2222:22 $IMAGE_NAME:$IMAGE_VERSION ${server_exec}" if [[ ${retval} != 0 ]]; then echo -e "${REDB}Failed to run docker image! (exit code: ${retval})${CLR}" exit 1 @@ -603,8 +603,8 @@ run_policy_test() { expected_exit_code=$6 - #echo "Running: docker run -d -p 2222:22 $IMAGE_NAME:$IMAGE_VERSION ${server_exec}" - cid=$(docker run -d -p 2222:22 "${IMAGE_NAME}:${IMAGE_VERSION}" ${server_exec}) + #echo "Running: docker run --rm -d -p 2222:22 $IMAGE_NAME:$IMAGE_VERSION ${server_exec}" + cid=$(docker run --rm -d -p 2222:22 "${IMAGE_NAME}:${IMAGE_VERSION}" ${server_exec}) retval=$? if [[ ${retval} != 0 ]]; then echo -e "${REDB}Failed to run docker image! (exit code: ${retval})${CLR}"