Bird
0
0

A Dockerfile has this line:

medium📝 Debug Q7 of 15
Remix - Deployment
A Dockerfile has this line:
COPY package.json /app/

but the build fails with 'no such file or directory'. What should you check?
AAdd EXPOSE before COPY command.
BEnsure package.json exists in the build context folder.
CChange COPY to RUN for copying files.
DRemove WORKDIR command.
Step-by-Step Solution
Solution:
  1. Step 1: Understand COPY command

    COPY copies files from build context (local folder) into container.
  2. Step 2: Check file presence

    If package.json is missing locally, COPY fails; other options do not fix missing file error.
  3. Final Answer:

    Ensure package.json exists in the build context folder. -> Option B
  4. Quick Check:

    COPY source file must exist locally [OK]
Quick Trick: COPY source files must be in build folder [OK]
Common Mistakes:
MISTAKES
  • Using RUN instead of COPY
  • Adding unrelated EXPOSE command
  • Removing WORKDIR unnecessarily

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Remix Quizzes