kaniko
kaniko copied to clipboard
GCP: Kaniko executor cannot find dockerfile when running `gcloud builds submit` locally.
Actual behavior
Kaniko executor cannot find dockerfile when running gcloud builds submit locally. The build works fine in Google Cloud Build.
Error thrown:
Step #0 - "Build": Error: error resolving dockerfile path: please provide a valid path to a Dockerfile within the build context with --dockerfile
Expected behavior The build to run
To Reproduce Steps to reproduce the behavior:
- Run
gcloud builds submit ./ --config=./cloudbuild.yaml
Additional Information Cloudbuild.yaml
steps:
- name: 'gcr.io/kaniko-project/executor:latest'
id: Build
args:
- --destination=$_GCR_HOSTNAME/$PROJECT_ID/$REPO_NAME/$_SERVICE_NAME:$_CLEANTAG_NAME
- --cache=true
- --log-timestamp=true
- --dockerfile=project-dir/Dockerfile.prod.services
- --context=dir://project-dir
env:
- 'DOCKER_BUILDKIT=1'
- 'BUILDKIT_PROGRESS=plain'
Triage Notes for the Maintainers
| Description | Yes/No |
|---|---|
| Please check if this a new feature you are proposing |
|
| Please check if the build works in docker but not in kaniko |
|
Please check if this error is seen when you use --cache flag |
|
| Please check if your dockerfile is a multistage dockerfile |
|
I face this problem as well.