I need to create a persistent volume for Docker. The volume must be named extra-addons and located in /mnt/.

I run this command:

sudo docker volume create /mnt/extra-addons

I got this error message:

Error response from daemon: create /mnt/extra-addons: "/mnt/extra-addons" includes invalid characters for a local volume name, only "[a-zA-Z0-9][a-zA-Z0-9_.-]" are allowed. If you intended to pass a host directory, use absolute path

Note that when I simply run: sudo docker volume create extra-addons, I do not face this problem but when I inspect the volume in question using sudo docker inspect extra-addons, I see it is located in a place I do not want:

Creates a test.txt file on my host machine. At the specified path. This is now a two way read/write shared folder. Multiple containers can mount the same folder. And it'll persist once you shut your container/s down.