pantsbuild / pants

The Pants Build System
https://www.pantsbuild.org
Apache License 2.0
3.26k stars 626 forks source link

Docker containers used by a docker_environment are not cleaned when using `--no-pantsd` #21328

Open gcbirzan-plutoflume opened 3 weeks ago

gcbirzan-plutoflume commented 3 weeks ago

Describe the bug Using a docker_environment with --no-pantsd will leave that docker container around when the package command is done.

Pants version 2.18

OS macos, but I doubt it's related.

Additional info

cbirzan@GP3CMXYV9V:~/PycharmProjects/cr_python$ docker ps | wc -l
      10
cbirzan@GP3CMXYV9V:~/PycharmProjects/cr_python$ pants --no-pantsd  --session-end-tasks-timeout=30000 package apps/airflow_db_reader:bin
21:31:20.72 [INFO] Reading /Users/cbirzan/PycharmProjects/cr_python/.python-version to determine desired version for [python-bootstrap].search_path.
21:31:29.38 [INFO] Wrote dist/apps.airflow_db_reader/bin.pex
cbirzan@GP3CMXYV9V:~/PycharmProjects/cr_python$ docker ps | wc -l
      11
cbirzan@GP3CMXYV9V:~/PycharmProjects/cr_python$ pants --no-pantsd  --session-end-tasks-timeout=30000 package apps/airflow_db_reader:bin
21:31:36.80 [INFO] Reading /Users/cbirzan/PycharmProjects/cr_python/.python-version to determine desired version for [python-bootstrap].search_path.
21:31:45.50 [INFO] Wrote dist/apps.airflow_db_reader/bin.pex
cbirzan@GP3CMXYV9V:~/PycharmProjects/cr_python$ docker ps | wc -l
      12
cbirzan@GP3CMXYV9V:~/PycharmProjects/cr_python$
gcbirzan-plutoflume commented 3 weeks ago

I've made a repo that reproduces this issue with 2.21: https://github.com/gcbirzan-plutoflume/pants-test