How to hold the db data in local machine with docker?

I start docker with this command on Windows:

docker run -it -p 5080:5080 -p 6080:6080 -p 8080:8080 \
 -p 9080:9080 -p 8000:8000 -v ~/dgraph:/dgraph --name dgraph \
  dgraph/standalone

when I restart my computer, all the data are lost, and the dgraph folder(in the user root) is always empty. how to hold the data? what I miss ?

in addition, I always pull the latest version of dgraph/standalone and didn’t indicate the version in the terminal .

I guess this binding won’t work on Windows.

Docker for windows needs to activate the Share drivers and use Windows syntax in the command. Something like -v //c/dgraph/:/dgraph or -v "c:\dgraph":/dgraph. There are several blog posts about it.

I have tested here(macOS, but makes no difference) and it shows. If you are seeing the logs I’m 100% sure that it will print the version in the logs.

Here one https://rominirani.com/docker-on-windows-mounting-host-directories-d96f3f056a2c

@MichelDiz yes ! the file system cause it ,thanks very much !