Setting up DGL Docker Container

Hi everyone,

I’m a student that’s brand new to Docker and would love some feedback from the wider community, so please bear with me if my questions seem trivial.

I am currently trying to run a Python project by utilizing a Docker container built by DGL. More info on this container here:

I successfully downloaded Docker Desktop along with the DGL container, got it running and was able to access it from the shell. I was also able to run the examples that came with DGL’s container by default.

Next, I attempted to bind mount my Python project that’s located on my local machine so that I can run the project from within the DGL container using the following command:

docker run --gpus all -it --rm -v "C:/Users/Tim P/PycharmProjects/WTAGraphModified/" -w /workspace/WTAGraphModified/ nvcr.io/nvidia/dgl:24.09-py3

The command generates a new container and I am able to access it from the shell. Within the container, a new directory is created at /workplace/WTAGraphModified as specified in the command, but the contents are completely empty. I tried many variations of the local path to my Python project in the command but am unable to successfully bind mount my project to the container – I end up with an empty directory on the container every time.

Does anyone have any idea why this is happening? Any suggestions are much appreciated!

You just made an anonymous volume. Meaning you have no source path, only a destination But since you have C:/ it is also possible that you mounted a volume called “C” into the path defined after the colon.

You can find volume examples in the documentation

Or in my tutorials using Docker Compose.

From command line it is probably better using the long syntax with the mount option.

--mount type=bind,source=C:/Users/Tim P/PycharmProjects/WTAGraphModified/,target=workspace/WTAGraphModified/"

Note that -w only sets the workspace. It has nothing to do with the volume moiunt point in the container.

1 Like

Thanks for the explanation, this was super helpful. The docker command with the mount option did the trick for me!