Bird
0
0

You have this GitHub Actions step:

medium📝 Troubleshoot Q14 of 15
Docker - in CI/CD
You have this GitHub Actions step:
run: docker build -t myapp .
run: docker run myapp
The workflow fails with 'Error: Dockerfile not found'. What is the likely cause?
AThe Dockerfile is missing in the repository
BThe two 'run' commands are separate steps and do not share state
CThe image name 'myapp' is invalid
DThe 'docker run' command syntax is incorrect
Step-by-Step Solution
Solution:
  1. Step 1: Understand docker build requirement

    The 'docker build .' command requires a Dockerfile in the current directory (repo root after checkout).
  2. Step 2: Identify the error cause

    If the Dockerfile is missing from the repository, the build step fails with 'Dockerfile not found' error.
  3. Final Answer:

    The Dockerfile is missing in the repository -> Option A
  4. Quick Check:

    docker build fails = no Dockerfile [OK]
Quick Trick: Ensure Dockerfile exists in repository root [OK]
Common Mistakes:
  • Thinking separate steps prevent image sharing
  • Assuming image name 'myapp' is invalid
  • Believing 'docker run' syntax causes the error

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Docker Quizzes