如何在没有 FBConfig 错误的情况下 运行 在 docker 中填满应用程序?

How to run glut app inside docker without FBConfig error?

所以,我需要在 Ubuntu 上开发 运行 一个特定的图形用户界面应用程序。应用程序基于 OpenGLfreeglut。我想从 macbook 开发,所以我尝试使用 vs 代码远程容器 功能。它运行良好,直到我需要 运行 这个应用程序。我在容器中安装了很多各种 gl 包,运行 它与 xquarts 等

现在我遇到了过剩的问题:freeglut (my_app): ERROR: Internal error <FBConfig with necessary capabilities not found> in function fgOpenWindow。正如我发现 there,这是一个已知的过剩和远程连接错误。从 2009 年就知道了!那么有谁知道,如何摆脱它?或者我永远不会 运行 我的应用程序 docker?

我当前的 Dockerfile:

FROM nvidia/cudagl:9.0-devel-ubuntu16.04

# This Dockerfile's base image has a non-root user with sudo access. Use the "remoteUser"
# property in devcontainer.json to use it. On Linux, the container user's GID/UIDs
# will be updated to match your local UID/GID (when using the dockerFile property).
# See https://aka.ms/vscode-remote/containers/non-root-user for details.
ARG USERNAME=user

ENV DEBIAN_FRONTEND noninteractive

# Adding new architecture in package base
RUN dpkg --add-architecture i386

# Installg tools
RUN apt-get update \
    && apt-get -y install sudo software-properties-common zsh wget

# Installing latest git
RUN add-apt-repository ppa:git-core/ppa \
    && apt-get update \
    && apt-get -y install git

# Install C++ tools
RUN apt-get -y install build-essential gcc-multilib g++-multilib cmake cppcheck valgrind

# Install some dependencies
RUN apt-get -y install libc6-dev-i386 libgl1-mesa-dev libglu1-mesa-dev freeglut3 freeglut3-dev libjpeg-turbo8-dev libpng12-dev mesa-utils

# Install dependencies with another architecture
RUN apt-get -y install libgl1-mesa-dev:i386 libglu1-mesa-dev:i386 freeglut3:i386 freeglut3-dev:i386 libpng12-0:i386

# Install nvidia driver
RUN apt-get install -y binutils xserver-xorg-video-all

# Adding new user
RUN groupadd --gid 2000 $USERNAME \
    && useradd --uid 2000 --gid $USERNAME --shell /bin/zsh --create-home $USERNAME \
    && echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME

# Clean up
RUN apt-get autoremove -y \
    && apt-get clean -y \
    && rm -rf /var/lib/apt/lists/*

USER $USERNAME

ENV DEBIAN_FRONTEND interactive

我不知道怎么做,但现在可以了!我尝试使用了很多东西,所以我不知道到底是什么帮助了我。所以我会尽量告诉一切:

  1. Docker 基本图像变为 Ubuntu 14.04。我之前已经试过了,但是没用。
  2. 我已经将 XQuartz 降级到 2.7.8 版本
  3. 我已将其粘贴到终端中:defaults write org.macosforge.xquartz.X11 enable_iglx -bool true

以防万一,这是我的新 Docker 文件:

FROM ubuntu:14.04

# This Dockerfile's base image has a non-root user with sudo access. Use the "remoteUser"
# property in devcontainer.json to use it. On Linux, the container user's GID/UIDs
# will be updated to match your local UID/GID (when using the dockerFile property).
# See https://aka.ms/vscode-remote/containers/non-root-user for details.
ARG USERNAME=user

ENV DEBIAN_FRONTEND noninteractive

# Adding new architecture in package base
RUN dpkg --add-architecture i386

# Install tools
RUN apt-get update \
    && apt-get -y install sudo software-properties-common zsh wget

# Install last git
RUN add-apt-repository ppa:git-core/ppa \
    && apt-get update \
    && apt-get -y install git

# Install C++ tools
RUN apt-get -y install build-essential gcc-multilib g++-multilib cmake cppcheck valgrind

# Install some dependencies
RUN apt-get -y install libc6-dev-i386 libgl1-mesa-dev libglu1-mesa-dev freeglut3 freeglut3-dev libjpeg-turbo8-dev libpng12-dev mesa-utils

# Install dependencies with another architecture
RUN apt-get -y install libgl1-mesa-dev:i386 libglu1-mesa-dev:i386 freeglut3:i386 freeglut3-dev:i386 libpng12-0:i386

# Install nvidia driver
RUN apt-get install -y binutils xserver-xorg-video-all

# Adding new user
RUN groupadd --gid 2000 $USERNAME \
    && useradd --uid 2000 --gid $USERNAME --shell /bin/zsh --create-home $USERNAME \
    && echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME

# Clean up
RUN apt-get autoremove -y \
    && apt-get clean -y \
    && rm -rf /var/lib/apt/lists/*

USER $USERNAME

ENV DEBIAN_FRONTEND interactive