[docker] Add Dockerfile that builds skiaserve.

Bug: skia:
Change-Id: If43c546fd7909329a015302580bc50925f4b7630
Reviewed-on: https://skia-review.googlesource.com/128313
Commit-Queue: Joe Gregorio <jcgregorio@google.com>
Auto-Submit: Joe Gregorio <jcgregorio@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
This commit is contained in:
Joe Gregorio 2018-05-15 16:25:54 -04:00 committed by Skia Commit-Bot
parent d7c7978d8c
commit f2dbd7546c
2 changed files with 57 additions and 0 deletions

4
docker/README.md Normal file
View File

@ -0,0 +1,4 @@
Docker
======
Docker files for building different Skia targets.

View File

@ -0,0 +1,53 @@
# Dockerfile for building skiaserve with SwiftShader.
FROM launcher.gcr.io/google/clang-debian9 AS build
ADD https://storage.googleapis.com/swiftshader-binaries/OpenGL_ES/Latest/Linux/libGLESv2.so /usr/local/lib/libGLESv2.so
ADD https://storage.googleapis.com/swiftshader-binaries/OpenGL_ES/Latest/Linux/libEGL.so /usr/local/lib/libEGL.so
RUN mkdir -p /tmp/skia/out/Static
RUN echo ' \n\
cc = clang \n\
cxx = clang++ \n\
skia_use_egl = true \n\
is_debug = false \n\
skia_use_system_freetype2 = false \n\
extra_cflags = [ \n\
"-I/tmp/swiftshader/include", \n\
"-DGR_EGL_TRY_GLES3_THEN_GLES2", \n\
] \n\
extra_ldflags = [ \n\
"-L/usr/local/lib", \n\
"-Wl,-rpath", \n\
"-Wl,/usr/local/lib" \n\
] ' > /tmp/skia/out/Static/args.gn
RUN apt-get update && apt-get install -y \
git \
python \
curl \
build-essential \
libfontconfig-dev \
libfreetype6-dev \
libgl1-mesa-dev \
libglu1-mesa-dev \
lsb-release \
&& cd /tmp \
&& git clone 'https://chromium.googlesource.com/chromium/tools/depot_tools.git' \
&& export PATH="${PWD}/depot_tools:${PATH}" \
&& git clone https://swiftshader.googlesource.com/SwiftShader swiftshader \
&& mkdir -p /tmp/skia \
&& cd /tmp/skia \
&& fetch skia \
&& cd skia \
&& python tools/git-sync-deps \
&& ./bin/fetch-gn \
&& gn gen out/Static \
&& ninja -C out/Static
FROM launcher.gcr.io/google/debian9
ADD https://storage.googleapis.com/swiftshader-binaries/OpenGL_ES/Latest/Linux/libGLESv2.so /usr/local/lib/libGLESv2.so
ADD https://storage.googleapis.com/swiftshader-binaries/OpenGL_ES/Latest/Linux/libEGL.so /usr/local/lib/libEGL.so
RUN apt-get update && apt-get install -y \
libfontconfig \
libglu1-mesa \
xvfb \
&& rm -rf /var/lib/apt/lists/*
COPY --from=build /tmp/skia/skia/out/Static/skiaserve /bin/skiaserve
ENTRYPOINT DISPLAY=:99 /usr/bin/xvfb-run --server-args "-screen 0 1280x1024x24" /bin/skiaserve --address 0.0.0.0