Docker running Jupyter Notebook – `'no $DISPLAY environment variable'?

I am running a Docker container with Jupyter Notebook using:

sudo nvidia-docker run -it -v /media/files:/files -p 8888:8888 -p 6001:6001 mybigdocker:latest

  • docker-compose v3 + apache spark, connection refused on port 7077
  • tinyproxy not tracing xmlhttprequest
  • Dockerfile Dynamic Registry for Image
  • Cannot download docker images behind proxy : Timeout : Docker for Mac
  • Dockerized Angular 4, Django and postgresql - Process exited with status 127, error code=H10 desc=“App crashed”
  • systemd not waiting for my service unit to finish before starting the next one
  • And then connecting to it at in Chrome.

    Everything works fine, except if I try to do anything with matplotlib, or any type of non-text output, where I get the error:

    TclError: no display name and no $DISPLAY environment variable

    I have tried adding --env="DISPLAY" and --env=$DISPLAY and --env=":0" with no avail.

    How do I fix this?

  • Docker container stuck after enter in container
  • fabric8io docker-maven-plugin in Windows
  • Docker multiple entrypoints
  • Error starting docker containers
  • Cannot open firefox in Docker container
  • From inside of a Docker container, how do I connect to the localhost of the machine?
  • Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.