Initially verifies if any volumes exist.
docker volume ls

Creates a volume named testvol1 and verifies it.
docker volume create testvol1
docker volume ls

Mounts the volume to /home/app and writes data.
docker run -it --rm -v testvol1:/home/app ubuntu /bin/bash
echo "sapid=500121882" >> /home/app/sapid.txt
cat /home/app/sapid.txt
exit

Runs a new container and checks if file persists.
docker run -it --rm -v testvol1:/home/app ubuntu /bin/bash
cat /home/app/sapid.txt

Creates a host folder and mounts it to container.
docker run -it --rm -v $(pwd)/hostfolder:/data ubuntu /bin/bash
echo "Hello from bind mount" >> /data/test.txt
cat /data/test.txt
exit

Checks file directly from host directory.
cat hostfolder/test.txt

Creates volume myvolume.
docker volume create myvolume
docker volume ls

Mounts myvolume and writes data.
docker run -it --rm -v myvolume:/data ubuntu /bin/bash
echo "Hello from named volume" >> /data/file.txt
cat /data/file.txt
exit

Runs new container to confirm data persistence.
docker run -it --rm -v myvolume:/data ubuntu /bin/bash
cat /data/file.txt

Docker volumes and bind mounts were successfully created and tested.
Data persisted across multiple container executions.