CircleCI Docker build is not passing env vars through

I’m using the ecr orb to build and push my image to the registry however, the circleci env vars are not available in the build process for some reason.

Here’s my config.yml

( i’ve commented out some of the steps to troubleshoot )

version: 2.1
orbs:
  aws-ecr: circleci/[email protected]
  aws-ecs: circleci/[email protected]
jobs:
  build:
    docker:
      - image: circleci/python:3.7
    steps:
      - checkout
      - restore_cache:
          keys:
            - cache-{{ checksum "Pipfile.lock" }}
            - cache-
      - run:
          name: Install dependencies
          command: pipenv sync --dev
      - save_cache:
          key: cache-{{ checksum "Pipfile.lock" }}
          paths:
            - ~/.local
            - ~/.cache
      - run:
          name: 'Lint Flake8'
          command: pipenv run flake8

      # - run:
      #     name: 'Test'
      #     command: |
      #       ENVIRONMENT=development pipenv run python src/manage.py test --noinput
workflows:
  build-and-deploy:
    jobs:
      - build
      - aws-ecr/build_and_push_image:
          account-url: AWS_ECR_ACCOUNT_URL
          aws-access-key-id: AWS_ACCESS_KEY_ID
          aws-secret-access-key: AWS_SECRET_ACCESS_KEY
          repo: "dev-portal"
          region: AWS_DEFAULT_REGION
          tag: "${CIRCLE_SHA1}"
          requires:
            - build
          filters:
            branches:
              only: circleci/aws-ecs-deploy
      # - aws-ecs/deploy-service-update:
      #     requires:
      #       - aws-ecr/build_and_push_image
      #     filters:
      #       branches:
      #         only: circleci/aws-ecs-deploy
      #     aws-region: AWS_DEFAULT_REGION
      #     family: "${AWS_RESOURCE_NAME_PREFIX}-service"
      #     cluster-name: "${AWS_RESOURCE_NAME_PREFIX}-cluster"
      #     container-image-name-updates: "container=${AWS_RESOURCE_NAME_PREFIX}-service,image-and-tag=${AWS_ACCOUNT_ID}.dkr.ecr.${AWS_DEFAULT_REGION}.amazonaws.com/nginx-portal:${CIRCLE_SHA1}"
      #     verify-revision-is-deployed: true
      #     post-steps:
      #       - run:
      #           name: Test the deployment
      #           command: |
      #             TARGET_GROUP_ARN=$(aws ecs describe-services --cluster ${AWS_RESOURCE_NAME_PREFIX}-cluster --services ${AWS_RESOURCE_NAME_PREFIX}-service | jq -r '.services[0].loadBalancers[0].targetGroupArn')
      #             ELB_ARN=$(aws elbv2 describe-target-groups --target-group-arns $TARGET_GROUP_ARN | jq -r '.TargetGroups[0].LoadBalancerArns[0]')
      #             ELB_DNS_NAME=$(aws elbv2 describe-load-balancers --load-balancer-arns $ELB_ARN | jq -r '.LoadBalancers[0].DNSName')

What do i not understand about the orbs context / circleci’s env vars?

Thanks y’all!

Source: StackOverflow