[SOLVED] Failed to start dgraph standalone via docker (podman) on linux: can't write in attached `/dgraph` volume

Experience Report for Feature Request

What you wanted to do

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

Why that wasn’t great, with examples

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.

1 Like

Thanks for the info!

About adding this to docs, I think it is not necessary(in my opinion). Dgraph supports Docker and K8s only, also we should avoid documenting issues related to third-party software. That type of info is better here in the community or even StackOverflow. Imagine if Podman engineers fix it and we forget to update it - maintain support for more container engine is hard. Also, a software Doc should be scoped in its own context. The docs would be a mess adding all third-party software we may use.

Anyway, thanks for sharing it!

Cheers.

1 Like

Yes, I agree that if it’s podman related only it should not make it in the official docs. Your explanation makes sense. When I posted it I assumed it happened with docker as well because the claimed compatibility and I was probably wrong. I’ll add the issue on StackOverflow to make it more accessible.

Cheers

1 Like