Skip to content

Instantly share code, notes, and snippets.

@unicomp21
Created July 28, 2023 13:07
Show Gist options
  • Save unicomp21/0cf25c49e2c9f22caf8ee1b32d5d8cbd to your computer and use it in GitHub Desktop.
Save unicomp21/0cf25c49e2c9f22caf8ee1b32d5d8cbd to your computer and use it in GitHub Desktop.
filament webgl build failing
# Start from a Ubuntu image with the latest version of Ubuntu
FROM debian:latest
# Update and upgrade Ubuntu packages
RUN apt-get update && apt-get upgrade -y
# Install necessary packages (libglu1-mesa-dev vs libgl-dev)
RUN apt-get install -y git python3 cmake build-essential clang llvm libc++-dev libc++abi-dev libgl-dev
# Set Clang as default C and C++ compiler
RUN update-alternatives --install /usr/bin/cc cc /usr/bin/clang 100
RUN update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++ 100
# Clone and build Emscripten
WORKDIR /
RUN git clone https://github.com/emscripten-core/emsdk.git
WORKDIR /emsdk
RUN ./emsdk install latest
RUN ./emsdk activate latest
# Set up Emscripten environment variables
ENV EMSDK=/emsdk
ENV EM_CONFIG=/emsdk/.emscripten
ENV EM_CACHE=/emsdk/cache
ENV EM_PORTS=/emsdk/ports
# Add emscripten to PATH
ENV PATH="/emsdk:${PATH}"
ENV PATH="/emsdk/upstream/emscripten:${PATH}"
ENV PATH="/emsdk/node/16.20.0_64bit/bin:${PATH}"
# Copy Filament into the Docker container
COPY ./filament /filament
# Build Filament
WORKDIR /filament
RUN ./build.sh -p webgl release
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment