Kaniko: Kaniko lstat and Fd error

Created on 26 Nov 2018  路  5Comments  路  Source: GoogleContainerTools/kaniko

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 .

Most helpful comment

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.

All 5 comments

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

fkorotkov picture fkorotkov  路  3Comments

Vrtak-CZ picture Vrtak-CZ  路  5Comments

priyawadhwa picture priyawadhwa  路  4Comments

tejal29 picture tejal29  路  4Comments

maurorappa picture maurorappa  路  4Comments