You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I saw that docker/build-push-action@v2 is not applying a working-directory setup.
Here is my GitHub action file:
name: Push docker imageson:
push:
defaults:
run:
working-directory: ./api # here I setup working directory for flowjobs:
build:
runs-on: ubuntu-latesttimeout-minutes: 15steps:
- uses: actions/checkout@v2
- name: Set up Docker Buildxuses: docker/setup-buildx-action@v1
-
name: Build Docker Image - APIuses: docker/build-push-action@v2with:
file: dockerfiles/api/Dockerfilecontext: .push: falsetags: myimage:latest
Expected behaviour
Build image without error
Actual behaviour
/usr/bin/docker buildx build --tag myimage:latest --iidfile /tmp/docker-build-push-ed2Vyp/iidfile --file dockerfiles/api/Dockerfile .
error: could not find dockerfiles/api: stat dockerfiles/api: no such file or directory
Error: buildx call failed with: error: could not find dockerfiles/api: stat dockerfiles/api: no such file or directory
Fix
To fix this I have to pass file and context as path from root. In this case is:
Troubleshooting
I saw that
docker/build-push-action@v2
is not applying a working-directory setup.Here is my GitHub action file:
Expected behaviour
Build image without error
Actual behaviour
Fix
To fix this I have to pass
file
andcontext
as path from root. In this case is:With this fix I can build my image.
The text was updated successfully, but these errors were encountered: