Bird
0
0

In a GitHub Actions workflow, what will happen if you run this step?

medium📝 Command Output Q5 of 15
Docker - in CI/CD
In a GitHub Actions workflow, what will happen if you run this step?
run: docker run --rm myimage ls /app

Assuming 'myimage' exists and '/app' folder is inside the container.
AStarts container but does not show output
BDeletes the /app directory
CLists files inside /app directory
DFails because --rm is invalid
Step-by-Step Solution
Solution:
  1. Step 1: Understand docker run with --rm

    The '--rm' flag removes the container after it exits, it does not affect command output.
  2. Step 2: Understand 'ls /app' command

    This lists files inside the /app directory in the container.
  3. Final Answer:

    Lists files inside /app directory -> Option C
  4. Quick Check:

    docker run --rm lists files = A [OK]
Quick Trick: --rm cleans container after exit, output still shows [OK]
Common Mistakes:
  • Thinking --rm deletes files inside container
  • Assuming no output is shown
  • Believing --rm is an invalid flag

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Docker Quizzes