How to attach 🔗docker volume🐋🐋🐋
Attaching a volume to docker. how you can attach a volume to a Docker container:
- Create a Volume: Before attaching a volume, you need to create the volume. You can create a volume using the following command
docker volume create name //name can be anythin of the file where we want to write just like the folder name
2.To attach a volume to a Docker container, we can use the -v or --volume option when running the container.
docker run -d -v VOLUME_NAME:/path/in/container //here -d is detached mode, -v volume ,VOLUME_NAME is the name of the data that we created in previous command,: for attaching with,next is path inside the container