Quantcast
Channel: Active questions tagged ubuntu - Stack Overflow
Viewing all articles
Browse latest Browse all 7074

Error creating WebGL context: Three.js inside Docker

$
0
0

I created a dockerfile with alpine:3.19 as base image. Inside the dockerfile, I am installing following packages:

RUN set -xe \&& addgroup -g ${PGID} -S alpine \&& adduser -u ${PUID} -G alpine -h /home/alpine -D alpine \&& echo "https://dl-cdn.alpinelinux.org/alpine/v3.19/community" >> /etc/apk/repositories \&& apk update && apk upgrade \&& apk add --no-cache --purge -uU \        alsa-lib \        alsa-utils \        bash \        boost-dev \        bzip2-dev \        ca-certificates \        chromium \        cmake \        curl \        dbus-x11 \        font-noto \        font-noto-emoji \        freetype \        freetype-dev \        g++ \        gtk+3.0 \        harfbuzz \        libcanberra-gtk3 \        libexif \        libgcc \        libstdc++ \        libx11 \        libxcomposite \        libxdamage \        libxrandr \        libxtst \        linux-headers \        make \        mesa-dri-gallium \        mesa-egl \        mesa-gl \        pulseaudio \        python3 \        supervisor \        ttf-dejavu \        ttf-freefont \        udev \        unzip \        xorg-server \        xvfb \        zlib-dev \

Then I am doing some housekeeping such as following inside the dockerfile:

COPY app /appRUN chown -R alpine:alpine /appUSER alpineWORKDIR /app

After building the dockerfile, I am running it as shown below:

xhost +local:dockerdocker run -it -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix --privileged my_threejs_docker

The docker opens Chromium browser without any issue but the Three.js could not be initilized. See the error reported by dev tools below:

enter image description here

How to make Three.js render in Chromium browser inside Docker? BTW, I am using Ubuntu 20.04 LTS OS without any GPU support.


Viewing all articles
Browse latest Browse all 7074

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>