aboutsummaryrefslogtreecommitdiffstats
path: root/docker
diff options
context:
space:
mode:
authorKevin Lubick <kjlubick@google.com>2018-11-07 11:32:50 -0500
committerKevin Lubick <kjlubick@google.com>2018-11-07 16:35:44 +0000
commit70273a92aafca90035b652fa636b68b213dbb9d3 (patch)
treef6146ae8229419975d95d486361dbfd544332d3e /docker
parent62cc5f58174767db9247cb553496a65dd381db9c (diff)
downloadplatform_external_skqp-70273a92aafca90035b652fa636b68b213dbb9d3.tar.gz
platform_external_skqp-70273a92aafca90035b652fa636b68b213dbb9d3.tar.bz2
platform_external_skqp-70273a92aafca90035b652fa636b68b213dbb9d3.zip
Make the skia-wasm-release image only have the build products
The previous version had several gigs of buildtools, source code, etc. This is much smaller and easier to download for tools like jsfiddles.skia.org and (soon) skottie.skia.org Bug: skia: Change-Id: I748487abb1c6f6e82476076d22a27a5d4f90f75a Reviewed-on: https://skia-review.googlesource.com/c/169240 Reviewed-by: Kevin Lubick <kjlubick@google.com>
Diffstat (limited to 'docker')
-rw-r--r--docker/skia-wasm-release/Dockerfile22
1 files changed, 21 insertions, 1 deletions
diff --git a/docker/skia-wasm-release/Dockerfile b/docker/skia-wasm-release/Dockerfile
index 95209792fe..49cc27e6da 100644
--- a/docker/skia-wasm-release/Dockerfile
+++ b/docker/skia-wasm-release/Dockerfile
@@ -1,5 +1,5 @@
# Dockerfile for building the WASM libraries used by jsfiddle.skia.org
-FROM gcr.io/skia-public/emsdk-release:prod
+FROM gcr.io/skia-public/emsdk-release:prod as builder
RUN cd /tmp \
&& git clone 'https://chromium.googlesource.com/chromium/tools/depot_tools.git' \
@@ -16,3 +16,23 @@ RUN /tmp/skia/skia/modules/pathkit/compile.sh
# CanvasKit should be in /tmp/skia/skia/out/canvaskit_wasm
RUN /tmp/skia/skia/experimental/canvaskit/compile.sh
+
+RUN cd /tmp/skia/skia && git rev-parse HEAD > /tmp/VERSION
+
+#############################################################################
+# Multi-stage build part 2, in which we only have the compiled results and
+# a VERSION in /tmp
+# See https://docs.docker.com/develop/develop-images/multistage-build/
+#############################################################################
+
+FROM alpine:latest
+
+WORKDIR /tmp/
+
+RUN mkdir /tmp/pathkit /tmp/canvaskit
+
+COPY --from=builder /tmp/VERSION /tmp/VERSION
+
+COPY --from=builder /tmp/skia/skia/out/pathkit/pathkit* /tmp/pathkit/
+
+COPY --from=builder /tmp/skia/skia/out/canvaskit_wasm/canvaskit* /tmp/canvaskit/