Bird
0
0

In a CI pipeline, the command docker build -t app . fails with:

medium📝 Troubleshoot Q7 of 15
Docker - in CI/CD
In a CI pipeline, the command docker build -t app . fails with:
failed to solve: rpc error: code = Unknown desc = failed to copy files: no such file or directory

What is the most probable fix?
AChange the image tag to a valid name
BRestart the Docker daemon
CCheck that all files referenced in Dockerfile exist in the build context
DRun the build command with sudo
Step-by-Step Solution
Solution:
  1. Step 1: Understand error meaning

    Build failed because a file needed during build is missing in the context.
  2. Step 2: Identify fix

    Ensure all files COPY or ADDed in Dockerfile exist in the directory sent to docker build.
  3. Final Answer:

    Check that all files referenced in Dockerfile exist in the build context -> Option C
  4. Quick Check:

    Missing files cause build copy errors [OK]
Quick Trick: Verify all Dockerfile files exist in build folder [OK]
Common Mistakes:
  • Restarting daemon without checking files
  • Changing image tag unrelated to file errors
  • Running with sudo won't fix missing files

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Docker Quizzes