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).
package_format: str,
    version_suffix_for_pypi: str,
    use_container_for_assets_compilation: bool,
):
    perform_environment_checks()
    fix_ownership_using_docker()
    cleanup_python_generated_files()
    get_console().print("[info]Compiling assets\n")
    from sys import platform
    if platform == "darwin" and not use_container_for_assets_compilation:
        run_compile_www_assets(dev=False, run_in_background=False, force_clean=True)
    else:
        _compile_assets_in_docker()
    get_console().print("[success]Assets compiled successfully[/]")
    run_command(
        ["docker", "build", "--tag", AIRFLOW_BUILD_IMAGE_TAG, "-"],
        input=AIRFLOW_BUILD_DOCKERFILE,
        text=True,
        check=True,
        env={"DOCKER_CLI_HINTS": "false"},
    )
    run_command(
        cmd=[
            "docker",
            "run",
            "-t",
            "-v",
            f"{AIRFLOW_SOURCES_ROOT}:/opt/airflow:cached",
            "-e",