Run dgraph standalone as advised on the official docs
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:v21.03.0
The container failed to start with the errors
mkdir zw: permission denied and
Error while creating WAL dir.
This seems to be due to security restrictions imposed by docker and/or seLinux.
A similar issue was reported here when running a linux container with a local volume attached: Can't write into shared folder "Permission denied" · Issue #5821 · containers/podman · GitHub and I successfully overcame the problem with the suggested solution.
NOTE: podman is a docker compatible container runner which seems to be popular in the RedHat/Fedora community. The command line and semantics should be identical AFAIK.
The solution suggested was to append
:Z to the volume binding:
docker run … -v ~/dgraph:/dgraph:Z … dgraph/standalone:v21.03.0
Since I’m running a stock Fedora 34, I believe this problem may affect other users. The documentation makes no mention of this issue.