Skip to content

run_local_tests: Clean up container after listing tests#4083

Open
zhijianli88 wants to merge 1 commit into
flatcar:mainfrom
zhijianli88:local-test-rm-docker
Open

run_local_tests: Clean up container after listing tests#4083
zhijianli88 wants to merge 1 commit into
flatcar:mainfrom
zhijianli88:local-test-rm-docker

Conversation

@zhijianli88

Copy link
Copy Markdown
Contributor

The run_local_tests.sh script uses 'docker run' to execute 'kola list' and determine which tests to run. However, without the '--rm' flag, a stopped container instance is left behind after each execution.

Running the script multiple times leads to an accumulation of these exited containers, which consumes disk space and clutters the output of 'docker ps -a'.

Add the '--rm' flag to the 'docker run' command. This instructs Docker to automatically remove the container when it exits, ensuring no leftover artifacts. Since this container is only used temporarily to list tests, there is no need to preserve it.

[Title: describe the change in one sentence]

[ describe the change in 1 - 3 paragraphs ]

How to use

[ describe what reviewers need to do in order to validate this PR ]

Testing done

[Describe the testing you have done before submitting this PR. Please include both the commands you issued as well as the output you got.]

  • Changelog entries added in the respective changelog/ directory (user-facing change, bug fix, security fix, update)
  • Inspected CI output for image differences: /boot and /usr size, packages, list files for any missing binaries, kernel modules, config files, kernel modules, etc.

The run_local_tests.sh script uses 'docker run' to execute 'kola list'
and determine which tests to run. However, without the '--rm' flag, a
stopped container instance is left behind after each execution.

Running the script multiple times leads to an accumulation of these
exited containers, which consumes disk space and clutters the output of
'docker ps -a'.

Add the '--rm' flag to the 'docker run' command. This instructs Docker to
automatically remove the container when it exits, ensuring no leftover
artifacts. Since this container is only used temporarily to list tests,
there is no need to preserve it.

Signed-off-by: Li Zhijian <lizhijian@fujitsu.com>
@zhijianli88 zhijianli88 requested a review from a team as a code owner June 10, 2026 03:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant