The solution is to mount it on docker with -v to a local folder
Example
First on your host create the folder where parity is going to save the data
mkdir /srv/parity
Then make sure you have the latest version of parity
docker pull parity/parity:nightly
And finally create the container with the following parameters:
- -v /srv/parity:/root/.local/share/io.parity.ethereum/ (mount your local folder /srv/parity to the containers parity storage
Full run command:
docker run -ti -d -p 8545:8545 --name parity -v /srv/parity:/root/.local/share/io.parity.ethereum/ parity/parity:nightly --jsonrpc-interface '0.0.0.0' --jsonrpc-hosts="all" --author "0xYOURETHADDRESS" --auto-update="all" -d /mnt
Note: This command will also:
- Allow the JSON RPC interface to be accessed by anyone in your network so don't use this command on an exposed server
- Enable the auto-update of Parity which was introduced in 1.5
- Allows you to solo-mine by specifying the "author" parameter
After you ran the command you can verify that everything worked by checking the /srv/parity folder on your docker host

Bonus dev script:
You can use the following bash script to update parity whenever you like. It removes the old container, creates a new but keeps the data
#!/bin/sh
docker pull parity/parity:nightly
docker rm -f parity
docker run --restart always -ti -d \
-p 8180:8180 -p 8545:8545 -p 8546:8546 -p 30303:30303 -p 30303:30303/udp \
--name parity --restart always \
-v /srv/parity:/root/.local/share/io.parity.ethereum/ parity/parity:nightly \
--jsonrpc-interface '0.0.0.0' --jsonrpc-hosts="all" \
--author 0xYOURETHADDRESSHERE \
--auto-update="all" \
--stratum --stratum-interface=0.0.0.0 \
--jsonrpc-cors null \
--unsafe-expose \
--db-compaction hdd \
--mode active --cache-size 4096 \
--ui-interface 0.0.0.0 --ui-no-validation
docker logs --follow parity