code: def build_and_push_container(
      build, push, container, env_manager, mlflow_home
  ):
      """
      Build new MLflow Sagemaker image, assign it a name, and push to ECR.
  
      This function builds an MLflow Docker image.
      The image is built locally and it requires Docker to run.
      The image is pushed to ECR under current active AWS account and to current active AWS region.
      """
      env_manager = env_manager or em.VIRTUALENV
      if not (build or push):
          click.echo(
              "skipping both build and push, have nothing to do!"
          )
      if build:
          sagemaker_image_entrypoint = f"""
          ENTRYPOINT ["python", "-c", "import sys; from mlflow.models import container as C; \
          C._init(sys.argv[1], '{env_manager}')"]
          """
  
          def setup_container(_):
              return "\n".join(
                  [
                      'ENV {disable_env}="false"',
                      'RUN python -c "from mlflow.models.container import _install_pyfunc_deps;'
                      '_install_pyfunc_deps(None, False)"',
                  ]
              )
  
          mlflow.models.docker_utils._build_image(
              container,
              mlflow_home=os.path.abspath(mlflow_home)
              if mlflow_home
              else None,
              entrypoint=sagemaker_image_entrypoint,
              custom_setup_steps_hook=setup_container,
              env_manager=env_manager,
          )
      if push:
          mlflow.sagemaker.push_image_to_ecr(container)
  
file_path: mlflow/mlflow/sagemaker/cli.py
imports: import json
  import os
  import click
  import mlflow
  import mlflow.models.docker_utils
  import mlflow.sagemaker
  from mlflow.sagemaker import DEFAULT_IMAGE_NAME
  from mlflow.utils import cli_args
  from mlflow.utils import env_manager
label_desc: Use image node_id 5 for calling a global function with example usage: build_and_push_container(build, push, container, env_manager, mlflow_home) and returns: str