Using Persistent Storage
Containers are, by design, ephemeral and stateless. However, most real-world use cases require containers to produce or consume data that often needs to be persisted. To address this challenge, container engines offer mechanisms such as Bind mounts and Volumes. Both the docker and nerdctl CLIs provide options -v and --mount to start a container with a bind mount or a volume.
Bind mount​
Bind mount mounts a file or directory on the host machine into a container. For example, to mount the current directory of the host machine to /app/src directory of a container, you can use -v or the slightly verbose --mount as shown below.