CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES fe7323d95d8f amazinghao/ubuntu:graph_slam_clean "./startup.sh" 9 seconds ago Up 7 seconds 22/tcp, 0.0.0.0:5900->5900/tcp laser_slam_env
其实关键就是添加一个可视化的应用,如X11 apps (and GL), is the key for
display inside the docker,e.g.
1 2 3 4 5 6 7 8
#!/bin/bash # This file is covered by the LICENSE file in the root of this project. docker build -t api --build-arg uid=$(id -g) --build-arg gid=$(id -g) . docker run --privileged \ -ti --rm -e DISPLAY=$DISPLAY \ -v /tmp/.X11-unix:/tmp/.X11-unix \ -v $1:/home/data/ \ api
1
docker run --privileged -ti --rm -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix -v /home/amazinghao/Data:/home/data/ api
-e DISPLAY=$DISPLAY,after this the gui inside the
docker will show in the host machine
--privileged,will make all extend equippment
available for the docker