Debian Codegraph @

build/swiftshader/Dockerfile

raw
1 # Build the image:
2 # docker build --no-cache --tag ssfilament -f build/swiftshader/Dockerfile .
3 # docker tag ssfilament ghcr.io/filament-assets/swiftshader
4 #
5 # Publish the image:
6 # docker login ghcr.io --username <user> --password <token>
7 # docker push ghcr.io/filament-assets/swiftshader
8 #
9 # Run the image and mount the current directory:
10 # docker run -it -v `pwd`:/trees/filament -t ssfilament
11
12 FROM ubuntu:focal
13 WORKDIR /trees
14 ARG DEBIAN_FRONTEND=noninteractive
15 ENV SWIFTSHADER_LD_LIBRARY_PATH=/trees/swiftshader/build
16 ENV CXXFLAGS='-fno-builtin -Wno-pass-failed'
17
18 RUN apt-get update && \
19 apt-get --no-install-recommends install -y \
20 apt-transport-https \
21 apt-utils \
22 build-essential \
23 cmake \
24 ca-certificates \
25 git \
26 ninja-build \
27 python \
28 python3 \
29 xorg-dev \
30 clang-7 \
31 libc++-7-dev \
32 libc++abi-7-dev \
33 lldb
34
35 # Ensure that clang is used instead of gcc.
36 RUN set -eux ;\
37 update-alternatives --install /usr/bin/clang clang /usr/bin/clang-7 100 ;\
38 update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-7 100 ;\
39 update-alternatives --install /usr/bin/cc cc /usr/bin/clang 100 ;\
40 update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++ 100
41
42 # Get patch files from the local Filament tree.
43 COPY build/swiftshader/*.diff .
44
45 # Clone SwiftShader, apply patches, and build it.
46 RUN set -eux ;\
47 git clone https://swiftshader.googlesource.com/SwiftShader swiftshader ;\
48 cd swiftshader ;\
49 git checkout 139f5c3 ;\
50 git apply /trees/*.diff ;\
51 cd build ;\
52 cmake .. -GNinja -DCMAKE_BUILD_TYPE=Release ;\
53 ninja