Closed thorion3006 closed 4 years ago
FYI (and others who faced the same error)
append uses: actions/checkout@v1
before uses: kciter/aws-ecr-action@v1
to checkout the content of your repo. Afterwards with your project structure you can leave the path
part to default.
Example
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: kciter/aws-ecr-action@v1
with:
access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }}
secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
account_id: ${{ secrets.AWS_ACCOUNT_ID }}
repo: docker/repo
region: ap-northeast-2
tags: latest,${{ github.sha }}
create_repo: true
Ahoy my friends. we are three now !
having the same problem
I believe I found the issue with “path” not working and submitted a PR: #5
Discovered that the root cause of my issue was a docker problem, not a problem with this action. When trying to run a dockerfile in a subfolder, Docker requires that you add the path to the dockerfile in both the parameter specifying the file name (-f) and the PATH context (the '.' in 'docker build .'). When I tried reproducing in docker, I realized the docker command needed to be
docker build -f ./subfolder/my.Dockerfile ./subfolder
So the correct way to build a Dockerfile in a subfolder is to put the following two parameters in the step using this action
dockerfile: ./subfolder/my.Dockerfile
path: ./subfolder
FYI (and others who faced the same error) append
uses: actions/checkout@v1
beforeuses: kciter/aws-ecr-action@v1
to checkout the content of your repo. Afterwards with your project structure you can leave thepath
part to default.Example
jobs: build-and-push: runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 - uses: kciter/aws-ecr-action@v1 with: access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }} secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} account_id: ${{ secrets.AWS_ACCOUNT_ID }} repo: docker/repo region: ap-northeast-2 tags: latest,${{ github.sha }} create_repo: true
It worked for me. Thank you so much
Hey, I'm using your GitHub action to push my docker image to ecr, but the action fails every time complaing Dockerfile is missing.
My repo structure:
If i don't set the path variable in the job i get the following error:
If i set the path variable to
../../../Dockerfile
I get the following error:What should the path variable be set to?