Docker registry volume

hi, how can I have data persistent, when I use a confi.yml file.
I have a container “registry” and I uploaded a container test, but when I stop the container “registry” the data is lost.

this way works well…

docker run -d -p 5000:5000 --restart=always --name registry -v /mnt/registry:/var/lib/registry \registry

But I want to use a config.yml file…
this way does not work!!

docker run -d -p 5000:5000 --restart=always --name registry -v pwd/config.yml:/etc/docker/registry/config.yml -e \registry


version: 0.1
log:
fields:
service: registry
storage:
filesystem:
rootdirectory: /var/lib/registry
delete:
enabled: true
volumes:

  • /mnt/registry:/var/lib/registry
    http:
    addr: :5000

I dont know to do this. help please…

I dont know to delete the container test in the container “registry”