<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def setup_bash_in_container(builddir, _container, outfile, shell):
 """ Setup a bash environment inside a container. Creates a new chroot, which the user can use as a bash to run the wanted projects inside the mounted container, that also gets returned afterwards. """

    with local.cwd(builddir):
        # Switch to bash inside uchroot
        print("Entering bash inside User-Chroot. Prepare your image and "
              "type 'exit' when you are done. If bash exits with a non-zero"
              "exit code, no new container will be stored.")
        store_new_container = True
        try:
            run_in_container(shell, _container)
        except ProcessExecutionError:
            store_new_container = False

        if store_new_container:
            print("Packing new container image.")
            pack_container(_container, outfile)
            config_path = str(CFG["config_file"])
            CFG.store(config_path)
            print("Storing config in {0}".format(os.path.abspath(config_path)))