kciter / aws-ecr-action

This Action allows you to create Docker images and push into a ECR repository.
MIT License
146 stars 116 forks source link

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

Open ImAliMoussa opened 3 years ago

ImAliMoussa commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

Same here, thanks for the workaround @TorStava

AnkitRao17 commented 3 years ago

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:

-TIA

Silentassassin22 commented 2 years ago

Make sure Dockerfile has a capital d