How can I use matplotlib.pyplot in a docker container?

后端 未结 2 455
谎友^
谎友^ 2021-02-05 04:10

I have a certain setting of Python in an docker image named deep. I used to run python code

docker run --rm -it -v \"$PWD\":/app -w /app deep python         


        
2条回答
  •  青春惊慌失措
    2021-02-05 05:05

    Interestingly, I found quite nice and thorough solutions in ROS community. http://wiki.ros.org/docker/Tutorials/GUI

    For my problem, my final choice is the second way in the tutorial:

    docker run --rm -it \
       --user=$(id -u) \
       --env="DISPLAY" \
       --workdir=/app \
       --volume="$PWD":/app \
       --volume="/etc/group:/etc/group:ro" \
       --volume="/etc/passwd:/etc/passwd:ro" \
       --volume="/etc/shadow:/etc/shadow:ro" \
       --volume="/etc/sudoers.d:/etc/sudoers.d:ro" \
       --volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" \
       deepaul python test.python
    

提交回复
热议问题