Bird
0
0

Which Docker command correctly runs Cypress tests mounting the current folder as a volume?

easy📝 Syntax Q12 of 15
Cypress - CI/CD and Reporting
Which Docker command correctly runs Cypress tests mounting the current folder as a volume?
Adocker run -v $(pwd):/e2e -w /e2e cypress/included:12.0.0
Bdocker run -p 8080:80 cypress/included:12.0.0
Cdocker build -t cypress-test .
Ddocker run cypress/included:12.0.0 --no-volume
Step-by-Step Solution
Solution:
  1. Step 1: Identify volume mounting syntax

    The -v option mounts a folder; $(pwd):/e2e mounts current folder to /e2e in container.
  2. Step 2: Check command correctness

    docker run -v $(pwd):/e2e -w /e2e cypress/included:12.0.0 uses -v and -w to set working directory, which is correct for running Cypress tests.
  3. Final Answer:

    docker run -v $(pwd):/e2e -w /e2e cypress/included:12.0.0 -> Option A
  4. Quick Check:

    Volume mount = -v [OK]
Quick Trick: Use -v to mount volumes in Docker run command [OK]
Common Mistakes:
  • Using -p instead of -v for volume mounting
  • Forgetting to set working directory with -w
  • Confusing docker build with docker run

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Cypress Quizzes