aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Joe Gregorio <jcgregorio@google.com>2018-05-28 09:19:44 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-05-28 18:58:45 +0000
commitca8b0bd237eb2f4817352ce99fe82033ad39cb6d (patch)
treeec83c3a7c8815cee69d84bafc8932c8643d6c808
parent6e71f393b6cbfb439225574053462c3dfd356463 (diff)
Fix Dockerfile so args.gn actually applies, also drop debug symbols.
The part of the Dockerfile that extracted the skiaserve executable will be done in the skiabot repo. Bug: skia: Change-Id: Ieb913908d92626a7b9e68649b5c56b8f92646fd2 Reviewed-on: https://skia-review.googlesource.com/130323 Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: Joe Gregorio <jcgregorio@google.com>
-rw-r--r--docker/README.md10
-rw-r--r--docker/skia-release/Dockerfile50
-rw-r--r--docker/skiaserve/Dockerfile51
3 files changed, 60 insertions, 51 deletions
diff --git a/docker/README.md b/docker/README.md
index 9b3676d0d0..c237c61795 100644
--- a/docker/README.md
+++ b/docker/README.md
@@ -2,3 +2,13 @@ Docker
======
Docker files for building different Skia targets.
+
+Manual
+------
+
+There is a continuous process that builds this docker image, but if you
+need to manually push a verison, then run the following commands:
+
+ docker build -t skia-release ./docker/skia-release/
+ docker tag skia-release gcr.io/skia-public/skia-release:prod
+ docker push gcr.io/skia-public/skia-release:prod
diff --git a/docker/skia-release/Dockerfile b/docker/skia-release/Dockerfile
new file mode 100644
index 0000000000..fcf9f6d61c
--- /dev/null
+++ b/docker/skia-release/Dockerfile
@@ -0,0 +1,50 @@
+# Dockerfile for building Skia in release mode, using 3rd party libs from DEPS, with SwiftShader.
+FROM launcher.gcr.io/google/clang-debian9 AS build
+RUN apt-get update && apt-get upgrade -y && apt-get install -y \
+ git \
+ python \
+ curl \
+ build-essential \
+ libfontconfig-dev \
+ libgl1-mesa-dev \
+ libglu1-mesa-dev \
+ && groupadd -g 2000 skia \
+ && useradd -u 2000 -g 2000 skia
+
+USER skia
+
+ADD --chown=skia:skia https://storage.googleapis.com/swiftshader-binaries/OpenGL_ES/Latest/Linux/libGLESv2.so /usr/local/lib/libGLESv2.so
+ADD --chown=skia:skia https://storage.googleapis.com/swiftshader-binaries/OpenGL_ES/Latest/Linux/libEGL.so /usr/local/lib/libEGL.so
+RUN cd /tmp \
+ && git clone 'https://chromium.googlesource.com/chromium/tools/depot_tools.git' \
+ && export PATH="/tmp/depot_tools:${PATH}" \
+ && git clone https://swiftshader.googlesource.com/SwiftShader swiftshader \
+ && mkdir -p /tmp/skia \
+ && cd /tmp/skia \
+ && fetch skia
+
+RUN mkdir -p /tmp/skia/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\
+ "-g0", \n\
+] \n\
+extra_ldflags = [ \n\
+ "-L/usr/local/lib", \n\
+ "-Wl,-rpath", \n\
+ "-Wl,/usr/local/lib" \n\
+] ' > /tmp/skia/skia/out/Static/args.gn
+
+RUN cd /tmp/skia/skia \
+ && export PATH="/tmp/depot_tools:${PATH}" \
+ && python tools/git-sync-deps \
+ && ./bin/fetch-gn \
+ && gn gen out/Static \
+ && ninja -C out/Static \
+ && cd out/Static \
diff --git a/docker/skiaserve/Dockerfile b/docker/skiaserve/Dockerfile
deleted file mode 100644
index d7188fee4e..0000000000
--- a/docker/skiaserve/Dockerfile
+++ /dev/null
@@ -1,51 +0,0 @@
-# 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 \
- libgl1-mesa-dev \
- libglu1-mesa-dev \
- && 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 debian:testing-slim
-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 upgrade -y && apt-get install -y \
- libfontconfig1 \
- 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 --port 8000