A developer is working with a containerized application that processes user-uploaded files. The developer needs to ensure that these files are not lost when the container is stopped, removed, and then relaunched from the same image. Which strategy should the developer use to keep the files accessible across container lifecycles?
Store the files in environment variables that hold information used by the container.
Use ephemeral storage that is automatically cleared when the container stops.
Configure a mapped port to handle the incoming file data.
Use a data volume that is not tied to the container's lifecycle.
A data volume that is not tied to the container's lifecycle continues holding data when a container ends, making retrieval possible after redeployment. This type of volume is a form of persistent storage. Ephemeral storage is cleared once the container ends. Environment variables are meant for configuration data, not for storing application files. A mapped port is a networking concept used to direct traffic and does not preserve data.
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 a data volume in containerized applications?
Open an interactive chat with Bash
How does ephemeral storage differ from persistent storage in containers?
Open an interactive chat with Bash
Why are environment variables not suitable for long-term data storage in containers?