I've got a dockerfile shown as below .
FROM node:carbon
WORKDIR /usr/src/app
COPY package*.json ./
RUN npm install
COPY . .
After run that command /kaniko/executor --context project --dockerfile project/Dockerfile --no-push command after I've an error shown as below .
error building image: error building stage: lstat proc/49/fd/3: no such file or directory
What is the reason of this issue .
Sorry you're running into this @WoodProgrammer !
If you run this with docker build do you see the same error? What files are in the --context project dir?
I fixed error with using the $(pwd)/PROJECT_DIR style to give the project context and file path .
Ah great! I'll close this for now then, glad you figured it out :D
I fixed error with using the $(pwd)/PROJECT_DIR style to give the project context and file path .
Hello,
I am running into the same issue as you had.
Please, could you be more specific on how you fixed this ?
Thanks in advance.
Hope this can help other guys want to fix the same error. My project directory look like this:
- api_server
- Dockerfile
- cloudbuild.yaml
- some other nodejs files.....
- frontend
- other js files that not related to this build
If I want to build api_server docker image by using api_server/Dockerfile, here is the api_server/cloudbuild.yaml file I use:
steps:
- name: 'gcr.io/kaniko-project/executor:latest'
args:
- --dockerfile=api_server/Dockerfile
- --context=dir://workspace/api_server
- --destination=gcr.io/[YOUR_CONTAINER_PATH]/$PROJECT_ID:$TAG_NAME
- --cache=true
- --cache-ttl=24h
Once you specify the --context parameter, the no such file or directory error will have gone. Please also note that the reason why I use dir://workspace is that the Cloud Build worker VM pulls and runs with your source volume-mounted to /workspace.
https://cloud.google.com/cloud-build/docs/create-custom-build-steps
Most helpful comment
Hello,
I am running into the same issue as you had.
Please, could you be more specific on how you fixed this ?
Thanks in advance.