我正在尝试在具有Ubuntu 16.04的Docker容器上安装v-rep。
这是我的Dockerfile
:
FROM ubuntu:16.04
RUN apt-get update && apt-get -y install \
curl \
sudo
# Replace 1000 with your user / group id
RUN export uid=1000 gid=1000 && \
mkdir -p /home/developer && \
echo "developer:x:${uid}:${gid}:Developer,,,:/home/developer:/bin/bash" >> /etc/passwd && \
echo "developer:x:${uid}:" >> /etc/group && \
echo "developer ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/developer && \
chmod 0440 /etc/sudoers.d/developer && \
chown ${uid}:${gid} -R /home/developer
USER developer
ENV HOME /home/developer
RUN cd /home/developer && \
curl http://coppeliarobotics.com/files/V-REP_PRO_EDU_V3_5_0_Linux.tar.gz --output vrep.tar.gz && \
tar -xzf vrep.tar.gz && \
rm vrep.tar.gz
我运行容器
docker run -ti --rm \
-e DISPLAY=$DISPLAY \
-v /tmp/.X11-unix:/tmp/.X11-unix \
gvgramazio/vrep:latest
以便显示。然后,如果我使用./vrep.sh
运行v-rep,则会出现缺少依赖关系的错误。我用
./libLoadErrorCheck.sh
这是结果:
linux-vdso.so.1 => (0x00007ffec5dd8000)
liblua5.1.so (0x00007f2f5ac3c000)
libqscintilla2.so.9 (0x00007f2f5967b000)
libQt5OpenGL.so.5 (0x00007f2f59424000)
libQt5Widgets.so.5 (0x00007f2f58bf3000)
libQt5Gui.so.5 (0x00007f2f58446000)
libQt5SerialPort.so.5 (0x00007f2f5822d000)
libQt5Network.so.5 (0x00007f2f57e9c000)
libQt5Core.so.5 (0x00007f2f57764000)
libGL.so.1 => not found
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f2f57547000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f2f571c5000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f2f56ebc000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f2f56ca6000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f2f568dc000)
libQt5PrintSupport.so.5 (0x00007f2f5666e000)
libGL.so.1 => not found
libGL.so.1 => not found
libGL.so.1 => not found
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f2f56454000)
libicui18n.so.56 (0x00007f2f55fbb000)
libicuuc.so.56 (0x00007f2f55c03000)
libicudata.so.56 (0x00007f2f54220000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f2f54018000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f2f53e14000)
/lib64/ld-linux-x86-64.so.2 (0x00007f2f5ab42000)
libgthread-2.0.so.0 => not found
libglib-2.0.so.0 => not found
libGL.so.1 => not found
似乎我只有三个库:
libgthread-2.0.so.0
libglib-2.0.so.0
libGL.so.1
我使用
安装了库apt-get -y install libgl1-mesa-glx libglib2.0-0
但是尝试启动vrep时出现此错误。
This application failed to start because it could not find or load the Qt platform plugin "xcb"
in "".
Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, xcb.
Reinstalling the application may fix this problem.
./vrep.sh: line 33: 524 Aborted (core dumped) "$dirname/$appname" "${PARAMETERS[@]}"
我缺少什么?
我在github repository上发现了以下依赖性:
所以我已经将docker文件更新为:
FROM ubuntu:16.04
RUN apt-get update && apt-get -y install \
curl \
build-essential \
qtcreator \
qt5-default \
sudo
# Replace 1000 with your user / group id
RUN export uid=1000 gid=1000 && \
mkdir -p /home/developer && \
echo "developer:x:${uid}:${gid}:Developer,,,:/home/developer:/bin/bash" >> /etc/passwd && \
echo "developer:x:${uid}:" >> /etc/group && \
echo "developer ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/developer && \
chmod 0440 /etc/sudoers.d/developer && \
chown ${uid}:${gid} -R /home/developer
USER developer
ENV HOME /home/developer
RUN cd /home/developer && \
curl http://coppeliarobotics.com/files/V-REP_PRO_EDU_V3_5_0_Linux.tar.gz --output vrep.tar.gz && \
tar -xzf vrep.tar.gz && \
rm vrep.tar.gz
好消息是现在它可以在我的系统上运行了,坏消息是它仍然无法在我的docker容器上运行。这是尝试运行./vrep.sh
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-developer'
Using the default Lua library.
Loaded the video compression library.
libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
No XVisualInfo for format QSurfaceFormat(version 2.0, options QFlags<QSurfaceFormat::FormatOption>(), depthBufferSize -1, redBufferSize 1, greenBufferSize 1, blueBufferSize 1, alphaBufferSize -1, stencilBufferSize -1, samples -1, swapBehavior QSurfaceFormat::SwapBehavior(SingleBuffer), swapInterval 1, profile QSurfaceFormat::OpenGLContextProfile(NoProfile))
Falling back to using screens root_visual.
Add-on script 'vrepAddOnScript-addOnScriptDemo.lua' was loaded.
No XVisualInfo for format QSurfaceFormat(version 2.0, options QFlags<QSurfaceFormat::FormatOption>(), depthBufferSize 0, redBufferSize 1, greenBufferSize 1, blueBufferSize 1, alphaBufferSize -1, stencilBufferSize 0, samples -1, swapBehavior QSurfaceFormat::SwapBehavior(SingleBuffer), swapInterval -1, profile QSurfaceFormat::OpenGLContextProfile(NoProfile))
Falling back to using screens root_visual.
Could not initialize GLX
./vrep.sh: line 33: 16 Aborted (core dumped) "$dirname/$appname" "${PARAMETERS[@]}"
我采用了与Fabio Rehm's Blog中的容器共享x11套接字的想法,并且可以在firefox上正常工作,但是v-rep似乎有问题。所以现在我将尝试其他方法。