Unable to persist data locally from docker image

I am able to get a working instance of Dremio on Docker, but, I would like to persist the data on the container on my local.

I tried the solution mentioned in this post.

Upon running the following:

docker run --rm -v "/home/ubuntu/dremio/data/lib:/var/lib/dremio" -v "/home/ubuntu/dremio/data/localFiles:/localFiles" -v "/home/ubuntu/dremio/data/:/opt/dremio/data" -p 9047:9047 -p 31010:31010 -p 45678:45678 dremio/dremio-oss

It shows the following error when run in non-detached mode:

Dremio is exiting. Failure while starting services.
java.io.IOException: path /opt/dremio/data is not writable.

Any help would be appreciated.