Attach a cache or volume to an orb for the circleci/aws-ecr

I have a Docker build image that does a COPY . . and it assumes there is a .netrc file for fetching a private repository via go dep. The .netrc file is not something I commit and instead I generate the file during the CI process, which grabs an access token from an environment variable.

I need this .netrc file in there during the Docker build process for the circleci/aws-ecr orb.

Is there any way I can restore the vendor folder from a cache during this workflow job or a way to do a pre-step, such as make netrc, inside the working directory of the orb before the orb builds the Docker image?

      - aws-ecr/build_and_push_image:
          repo: myrepo
          tag: latest
          path: .
          dockerfile: Dockerfile
          attach-workspace: true
          requires:
            - test_and_build
          filters:
            tags:
              only: /^v.*/
            branches:
              ignore: /.*/

Actually, forget it . I have decided to use the aws-ecr/ecr-login and do my own thing in the jobs section.

Could you post how you went about doing this? Thanks!!

Any updates on this?
I have the same issue, but with node_modules.
Is there any way to add “pre-step” for ecr orb to restore_cache first?