kaniko icon indicating copy to clipboard operation
kaniko copied to clipboard

GCP: Kaniko executor cannot find dockerfile when running `gcloud builds submit` locally.

Open bhr opened this issue 3 years ago • 1 comments

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:

  1. 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
  • - [X]
Please check if this error is seen when you use --cache flag
  • - [X]
Please check if your dockerfile is a multistage dockerfile
  • - [X]

bhr avatar Jun 27 '22 14:06 bhr

I face this problem as well.

mizutaninaoki avatar Dec 28 '23 07:12 mizutaninaoki