We have a number of "in_container" scripts written in Bash, They are doing a number of houseekeeping stuff but since we already have Python 3.7+ inside the CI image, we could modularise them more and make them run from external and simplify entrypoint_ci (for example separate script for tests).
f" {warm_up_command_result.stdout} {warm_up_command_result.stderr}"
        )
OWNERSHIP_CLEANUP_DOCKER_TAG = (
    f"python:{DEFAULT_PYTHON_MAJOR_MINOR_VERSION}-slim-{ALLOWED_DEBIAN_VERSIONS[0]}"
)
def fix_ownership_using_docker(quiet: bool = False):
    if get_host_os() != "linux":
        # no 
        return
    cmd = [
        "docker",
        "run",
        "-v",
        "./scripts/in_container:/opt/airflow/scripts/in_container",
        "-e",
        f"HOST_OS={get_host_os()}",
        "-e",
        f"HOST_USER_ID={get_host_user_id()}",
        "-e",
        f"HOST_GROUP_ID={get_host_group_id()}",
        "-e",
        f"DOCKER_IS_ROOTLESS={is_docker_rootless()}",
        "-e",
        f"VERBOSE_COMMANDS={str(not quiet).lower()}",
        "-t",
        OWNERSHIP_CLEANUP_DOCKER_TAG,
        "/opt/airflow/scripts/in_container/run_fix_ownership.py",
    ]
    run_command(cmd, text=True, check=False, capture_output=quiet)
def remove_docker_networks(networks: list[str] | None = None) -> None: