Unable to prepare context: unable to evaluate symlinks in Dockerfile path

I am trying to build and push a Docker image using the aws-ecr orb. Here is my setup:

  • Starting from the root of my Git repository, my Dockerfile is located at ./services/api/Dockerfile.
  • The entirety of my .circleci/config.yml is as follows:
    version: 2.1
    orbs:
      aws-ecr: circleci/aws-ecr@6.5.0
    workflows:
      build-and-push-image:
        jobs:
          - aws-ecr/build-and-push-image:
              path: ./services/api
              account-url: AWS_ECR_ACCOUNT_URL
              repo: fair-value/api
              region: AWS_REGION
              tag: "${CIRCLE_SHA1}"
  • My build is failing with the following message:
    #!/bin/bash -eo pipefail
    docker_tag_args=""
    IFS="," read -ra DOCKER_TAGS <<< "${CIRCLE_SHA1}"
    for tag in "${DOCKER_TAGS[@]}"; do
      docker_tag_args="$docker_tag_args -t $AWS_ECR_ACCOUNT_URL/fair-value/api:$tag"
    done
    docker build \
       \
      -f Dockerfile \
      $docker_tag_args \
      ./services/api
    unable to prepare context: unable to evaluate symlinks in Dockerfile path: lstat /home/circleci/project/Dockerfile: no such file or directory
    Exited with code 1

It appears that CircleCI is looking for my Docker file in /home/circleci/project/Dockerfile, even though I have specified path: ./services/api in config.yml. I have even tried specifying the full path as /home/circleci/project/services/api to no avail.

Is anyone able to spot what I am doing wrong, or is this on the CircleCI side?

Thanks!

Found it. https://github.com/CircleCI-Public/aws-ecr-orb/issues/64

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.