From 9048179783bdd9cfdae3d6ca1a479eb970df61ff Mon Sep 17 00:00:00 2001 From: Bigous Date: Thu, 20 Oct 2022 11:41:03 -0300 Subject: [PATCH 1/2] feature(Script): New script to create a container from the image on windows. --- Create-Container.ps1 | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 Create-Container.ps1 diff --git a/Create-Container.ps1 b/Create-Container.ps1 new file mode 100644 index 0000000..22f9432 --- /dev/null +++ b/Create-Container.ps1 @@ -0,0 +1,15 @@ +$lines=(docker container ls --all -f "name=c_quick_bench") + +$ok_msg="You can run the container: docker start c_quick_bench" + +if($lines.Length -eq 2) { + Write-Host $ok_msg +} else { + Write-Host "Creating c_quick_bench" + docker create -v "$(pwd)/data:/data" -v "//var/run/docker.sock:/var/run/docker.sock" --env-file "$(pwd)\local.env" -e "BENCH_ROOT=$(pwd)" -p 4000:4000 --name c_quick_bench -it fredtingaud/bench-runner ./start-quick-bench + if($?) { + Write-Host $ok_msg + } else { + Write-Host "Could not create container." + } +} From bce744d49ef337bc4dbf22bb6239e816b99702f0 Mon Sep 17 00:00:00 2001 From: Bigous Date: Thu, 20 Oct 2022 11:58:40 -0300 Subject: [PATCH 2/2] fix(Containers): docker run command problem docker run without --name switch should always run with --rm to avoid creating a container each time it runs which never is executed again and never is deleted. --- build-bench | 2 +- quick-bench | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build-bench b/build-bench index 5674196..9a09916 100755 --- a/build-bench +++ b/build-bench @@ -1,3 +1,3 @@ #!/bin/bash -docker run -p 4000:4000 -v $PWD/data:/data -v /var/run/docker.sock:/var/run/docker.sock --env-file local.env -e BENCH_ROOT=$PWD -it fredtingaud/bench-runner ./start-build-bench +docker run --rm -p 4000:4000 -v $PWD/data:/data -v /var/run/docker.sock:/var/run/docker.sock --env-file local.env -e BENCH_ROOT=$PWD -it fredtingaud/bench-runner ./start-build-bench diff --git a/quick-bench b/quick-bench index 8fa9e42..f0a8a06 100755 --- a/quick-bench +++ b/quick-bench @@ -1,3 +1,3 @@ #!/bin/bash -docker run -p 4000:4000 -v $PWD/data:/data -v /var/run/docker.sock:/var/run/docker.sock --env-file local.env -e BENCH_ROOT=$PWD -it fredtingaud/bench-runner ./start-quick-bench +docker run --rm -p 4000:4000 -v $PWD/data:/data -v /var/run/docker.sock:/var/run/docker.sock --env-file local.env -e BENCH_ROOT=$PWD -it fredtingaud/bench-runner ./start-quick-bench