Kevin Lubick | 9617569 | 2018-11-05 17:28:53 -0500 | [diff] [blame] | 1 | # Dockerfile for building the WASM libraries used by jsfiddle.skia.org |
Kevin Lubick | 70273a9 | 2018-11-07 11:32:50 -0500 | [diff] [blame] | 2 | FROM gcr.io/skia-public/emsdk-release:prod as builder |
Kevin Lubick | 9617569 | 2018-11-05 17:28:53 -0500 | [diff] [blame] | 3 | |
| 4 | RUN cd /tmp \ |
| 5 | && git clone 'https://chromium.googlesource.com/chromium/tools/depot_tools.git' \ |
| 6 | && mkdir -p /tmp/skia \ |
| 7 | && cd /tmp/skia \ |
| 8 | && /tmp/depot_tools/fetch skia |
| 9 | |
| 10 | RUN cd /tmp/skia/skia \ |
| 11 | && python tools/git-sync-deps \ |
| 12 | && ./bin/fetch-gn |
| 13 | |
| 14 | # PathKit should be in /tmp/skia/skia/out/pathkit/ |
| 15 | RUN /tmp/skia/skia/modules/pathkit/compile.sh |
| 16 | |
| 17 | # CanvasKit should be in /tmp/skia/skia/out/canvaskit_wasm |
| 18 | RUN /tmp/skia/skia/experimental/canvaskit/compile.sh |
Kevin Lubick | 70273a9 | 2018-11-07 11:32:50 -0500 | [diff] [blame] | 19 | |
| 20 | RUN cd /tmp/skia/skia && git rev-parse HEAD > /tmp/VERSION |
| 21 | |
| 22 | ############################################################################# |
| 23 | # Multi-stage build part 2, in which we only have the compiled results and |
| 24 | # a VERSION in /tmp |
| 25 | # See https://docs.docker.com/develop/develop-images/multistage-build/ |
| 26 | ############################################################################# |
| 27 | |
| 28 | FROM alpine:latest |
| 29 | |
| 30 | WORKDIR /tmp/ |
| 31 | |
| 32 | RUN mkdir /tmp/pathkit /tmp/canvaskit |
| 33 | |
| 34 | COPY --from=builder /tmp/VERSION /tmp/VERSION |
| 35 | |
| 36 | COPY --from=builder /tmp/skia/skia/out/pathkit/pathkit* /tmp/pathkit/ |
| 37 | |
| 38 | COPY --from=builder /tmp/skia/skia/out/canvaskit_wasm/canvaskit* /tmp/canvaskit/ |