4
當我嘗試運行GUI,像XCLOCK比如我得到的錯誤:如何從一個碼頭工人容器內查看GUI應用
Error: Can't open display:
我試圖用多克爾運行ROS容器,我需要看看裏面運行的GUI應用程序。
我曾經使用過一個Vagrant虛擬機,並且能夠使用X11來完成它。
到目前爲止,我已經試過把路#1和#2成搬運工文件基礎上的信息在這裏: http://wiki.ros.org/docker/Tutorials/GUI
然後我試圖複製大多數dockerfile這裏: https://hub.docker.com/r/mjenz/ros-indigo-gui/~/dockerfile/
這裏的我目前的搬運工文件:
# Set the base image to use to ros:kinetic
FROM ros:kinetic
# Set the file maintainer (your name - the file's author)
MAINTAINER me
# Set ENV for x11 display
ENV DISPLAY $DISPLAY
ENV QT_X11_NO_MITSHM 1
# Install an x11 app like xclock to test this
run apt-get update
run apt-get install x11-apps --assume-yes
# Stuff I copied to make a ros user
ARG uid=1000
ARG gid=1000
RUN export uid=${uid} gid=${gid} && \
groupadd -g ${gid} ros && \
useradd -m -u ${uid} -g ros -s /bin/bash ros && \
passwd -d ros && \
usermod -aG sudo ros
USER ros
WORKDIR /home/ros
# Sourcing this before .bashrc runs breaks ROS completions
RUN echo "\nsource /opt/ros/kinetic/setup.bash" >> /home/ros/.bashrc
# Copy entrypoint script into the image, this currently echos hello world
COPY ./docker-entrypoint.sh/
ENTRYPOINT ["/docker-entrypoint.sh"]