code: def new_build(py_ver: PyVer):
      
      cache_file = f'app_{py_ver.name}.tar'
      cache_path = f'{cache_dir}/{cache_file}'
      cache_key = f'v3-{py_ver.name}-{{{{ .Branch }}}}'
      template = yaml.safe_load(f"""
      machine:
        image: 'circleci/classic:201710-02'
        docker_layer_caching: true
      steps:
        - checkout
        - restore_cache:
            keys: ['{cache_key}']
            paths: ['{cache_path}']
        - attach_workspace:
            at: {cache_dir}
        - run:
            name: Load docker image for TestRunner
            command: docker load -i {cache_dir}/{testrunner_cache}
        - run:
            name: Load docker image layer cache
            command: docker load -i {cache_path} || true  # silent failure if missing cache
        - run:
            name: Build application docker image
            command: >-
              docker build --cache-from={py_ver.tag}
              -t {py_ver.tag}
              --build-arg TESTRUNNER_VERSION=$(cat {cache_dir}/testrunner_version.txt)
              -f container/{py_ver.docker_file} .
        - run:
            name: Make cache directory
            command: mkdir -p {cache_dir}
        - run:
            name: Export docker image layer cache
            command: docker save -o {cache_path} {py_ver.tag}
        - save_cache: # cache is used between builds
            key: '{cache_key}'
            paths: ['{cache_path}']
        - persist_to_workspace: # workspace is used later in this same build
            root: {cache_dir}
            paths: '{cache_file}'
        
        # extracting documentation for review:
        - run:
            name: Start a named container
            command: docker run --name=SDK {py_ver.tag}
        - run:
            name: Extract the documentation
            command: 'docker cp SDK:/build/built_docs ./built_docs'
        - store_artifacts:
            path: built_docs
      """)
      return build_name(py_ver), template
docs: Job for building/caching different docker images