code: def build_docker(
      platform: str,
      registry: str,
      num_retries: int,
      no_cache: bool,
      cache_intermediate: bool = False,
  ) -> str:
      """
      Build a container for the given platform
      :param platform: Platform
      :param registry: Dockerhub registry name
      :param num_retries: Number of retries to build the docker image
      :param no_cache: pass no-cache to docker to rebuild the images
      :return: Id of the top level image
      """
      logging.info(
          "Building docker container '%s' based on ci/docker/docker-compose.yml",
          platform,
      )
      # We add a user with the same group as the executing non-root user so files created in the
      # container match permissions of the local user. Same for the group.
      cmd = [
          "docker-compose",
          "-f",
          "docker/docker-compose.yml",
          "build",
          "--build-arg",
          "USER_ID={}".format(os.getuid()),
          "--build-arg",
          "GROUP_ID={}".format(os.getgid()),
      ]
      if cache_intermediate:
          cmd.append("--no-rm")
      cmd.append(platform)
  
      env = os.environ.copy()
      env["DOCKER_CACHE_REGISTRY"] = registry
  
      @retry(subprocess.CalledProcessError, tries=num_retries)
      def run_cmd(env=None):
          logging.info("Running command: '%s'", " ".join(cmd))
          check_call(cmd, env=env)
  
      run_cmd(env=env)
  
file_path: mxnet/ci/build.py
imports: import argparse
  import pprint
  import os
  import signal
  import subprocess
  from itertools import chain
  from subprocess import check_call
  from typing import *
  import yaml
  from util import *
label_desc: Use image node_id 3 for calling a global function with example usage: build_docker(platform, registry, num_retries, no_cache, cache_intermediate) without return types