Build step: No such file or directory

Issue

Following error in the logs of the build step:

Step 3/6 : COPY /output /app
lstat output: no such file or directory

Possible cause

This issue generally occurs if you use an incorrect path to the Dockerfile or to the Build context.

Solution

Recheck, and use the correct path to Dockerfile and Build context

  1. The path to Dockerfile.
  1. The path to Build context. Build context is where we can find your Dockerfile as well as running commands. Your Dockerfile must be relative to this directory.

codefresh_no_such_file_directory.png

In case with codefresh.yml, to specify the path to build context you need to use working_directory

build step

step_name:
  type: build
  title: Step Title
  description: Free text description
  working_directory: path/to/buildcontext
  dockerfile: path/to/Dockerfile
  image_name: owner/new-image-name
  tag: develop

Troubleshooting common issues