A Docker image named web:v2 was previously built with the line
ENV LOG_LEVEL=info
You are asked to start a troubleshooting container from this image and force the application inside the container to use LOG_LEVEL=debugwithout rebuilding the image or modifying the Dockerfile.
Which single CLI option accomplishes this goal when the container is started?
The ENV instruction bakes the variable and its default value into the image, but any value provided with the -e/--env flag on docker run overrides the image's default for that specific container. Flags such as --build-arg apply only during docker build, docker container update cannot change environment variables, and setting variables on the host does not automatically propagate to running containers. Therefore, supplying -e LOG_LEVEL=debug at runtime is the correct and simplest method.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is the purpose of the 'ENV' instruction in a Dockerfile?
Open an interactive chat with Bash
How does the `-e` flag in `docker run` work?
Open an interactive chat with Bash
Why can't `--build-arg`, `docker container update`, or host-scope variables achieve the same outcome?
Open an interactive chat with Bash
CompTIA Linux+ XK0-006 (V8)
Services and User Management
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
IT & Cybersecurity Package Join Premium for Full Access