From f2dbd7546c3e02c27a57849276da223111134763 Mon Sep 17 00:00:00 2001 From: Joe Gregorio Date: Tue, 15 May 2018 16:25:54 -0400 Subject: [PATCH] [docker] Add Dockerfile that builds skiaserve. Bug: skia: Change-Id: If43c546fd7909329a015302580bc50925f4b7630 Reviewed-on: https://skia-review.googlesource.com/128313 Commit-Queue: Joe Gregorio Auto-Submit: Joe Gregorio Reviewed-by: Mike Klein --- docker/README.md | 4 +++ docker/skiaserve/Dockerfile | 53 +++++++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+) create mode 100644 docker/README.md create mode 100644 docker/skiaserve/Dockerfile diff --git a/docker/README.md b/docker/README.md new file mode 100644 index 0000000000..9b3676d0d0 --- /dev/null +++ b/docker/README.md @@ -0,0 +1,4 @@ +Docker +====== + +Docker files for building different Skia targets. diff --git a/docker/skiaserve/Dockerfile b/docker/skiaserve/Dockerfile new file mode 100644 index 0000000000..4d31b3f8f2 --- /dev/null +++ b/docker/skiaserve/Dockerfile @@ -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