Rust Project: Build and Push image to ECR

Hi, I am trying to build my rust project and push it against a repository in aws ecr using the orb aws-ecr: circleci/aws-ecr@8.1.2.

The problem is that in my cargo.toml file it references private dependencies, I have linked a machine user that I use to access private repositories of other projects but in this one I am getting an authentication error.

My config.yml:

version: 2.1

  aws-ecr: circleci/aws-ecr@8.1.2

      - aws-ecr/build-and-push-image:
          aws-access-key-id: AWS_ACCESS_KEY_ID_QA
          aws-cli-version: latest
          aws-secret-access-key: AWS_SECRET_ACCESS_KEY_QA
          #context: myContext
          create-repo: true
          dockerfile: Dockerfile
          executor: aws-ecr/default
          no-output-timeout: 5m
          path: .
          platform: linux/amd64
          public-registry: false
          push-image: true
          region: us-east-1
          registry-id: AWS_ACCOUNT_ID_QA
          repo: repo-name
          repo-scan-on-push: true
          tag: 'latest,myECRRepoTag'

My cargo.toml:

# Enable the "resolver" feature

cargo-features = ["resolver"]


codegen-units = 1

debug = true

lto = true


git-fetch-with-cli = true


channel = "nightly"

[url "ssh://"]

pushInsteadOf = ""

pushInsteadOf = "git://"


name = "project-name"

version = "1.1.0"

authors = ["Someone <>"]

edition = "2018"


xxx-xxx = "1.2"

yyy-yyy = "1.1"

private_dependency_1 = { git = "ssh://", tag = "1" }

private_dependency_2 = { git = "ssh://", tag = "1" }

In the Dockerfile I’m running this for authentication RUN mkdir -p -m 0600 ~/.ssh && ssh-keyscan >> ~/.ssh/known_hosts

And this is the error that I have, please help and thank you in advance.

I think I need to run something like git config --global url."".insteadOf “git://”, that’s why I added the section [url “ssh://”] in the cargo.toml file, however I seem to be having problems with that as well.