Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unable to prepare context: path "***.dkr.ecr.eu-central-1.amazonaws.com.." issue #35

Open
ImAliMoussa opened this issue Jul 9, 2021 · 4 comments

Comments

@ImAliMoussa
Copy link

I am getting this error not sure why

    secret_access_key: ***
    account_id: ***
    repo: vsr-repo
    region: eu-central-1
    create_repo: true
    tags: latest,36ca1f541dd2bd76c02c8187d30c877b05d08113

/usr/bin/docker run --name ghcriokciterawsecractionlatest_d69747 --label 8a33c1 --workdir /github/workspace --rm -e INPUT_ACCESS_KEY_ID -e INPUT_SECRET_ACCESS_KEY -e INPUT_ACCOUNT_ID -e INPUT_REPO -e INPUT_REGION -e INPUT_CREATE_REPO -e INPUT_TAGS -e HOME -e GITHUB_JOB -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RETENTION_DAYS -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_SERVER_URL -e GITHUB_API_URL -e GITHUB_GRAPHQL_URL -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e GITHUB_ACTION_REPOSITORY -e GITHUB_ACTION_REF -e GITHUB_PATH -e GITHUB_ENV -e RUNNER_OS -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e ACTIONS_CACHE_URL -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/vsr/vsr":"/github/workspace" ghcr.io/kciter/aws-ecr-action:latest
== START LOGIN
WARNING! Using -*** the CLI is insecure. Use --password-stdin.
WARNING! Your password will be stored unencrypted in /github/home/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store

Login Succeeded
== FINISHED LOGIN
== START DOCKERIZE
unable to prepare context: path "***.dkr.ecr.eu-central-1.amazonaws.com/vsr-repo:latest" not found

Here is my yaml file

name: ECR Build and Push
on: [push]
jobs:
  build-and-push:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - uses: docker://ghcr.io/kciter/aws-ecr-action:latest
      with:
        access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }}
        secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
        account_id: ${{ secrets.AWS_ACCOUNT_ID }}
        repo: vsr-repo
        region: eu-central-1
        create_repo: true
        tags: latest,${{ github.sha }}

My repo name is vsr-repo and I have already created it.

image

Dockerfile is in the root of the project.

The IAM user has admin acess. Not sure if I've done something wrong, help would be appreciated.

@TorStava
Copy link

Until this is fixed, this workaround allowed me to complete the action:

Replace - uses: docker://ghcr.io/kciter/aws-ecr-action:latest with - uses: kciter/aws-ecr-action@v3

@just-jeb
Copy link

Same here, thanks for the workaround @TorStava

@AnkitRao17
Copy link

AnkitRao17 commented Oct 27, 2021

Hi everyone,

I too faced the same issue and tried to use @TorStava s workaround. But further I'm facing the below issue:
unable to prepare context: unable to evaluate symlinks in Dockerfile path: lstat /github/workspace/Dockerfile: no such file or directory

Below is my .yaml file:

name: ECR Build and Push
on: [push]
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- uses: kciter/aws-ecr-action@v3
with:
access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }}
secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
account_id: ${{ secrets.AWS_ACCOUNT_ID }}
repo: demo-ankit-repo
region: eu-central-1
create_repo: true
tags: latest,${{ github.sha }}

-TIA

@Silentassassin22
Copy link

Make sure Dockerfile has a capital d

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants