blob: cd133e17e6386352fd48ff68799103462b9fe86d [file] [log] [blame]
Nathaniel Nifong036503b2019-04-01 15:00:57 -04001# Dockerfile for building the WASM libraries used by jsfiddle.skia.org and debugger.skia.org
Kevin Lubick70273a92018-11-07 11:32:50 -05002FROM gcr.io/skia-public/emsdk-release:prod as builder
Kevin Lubick96175692018-11-05 17:28:53 -05003
4RUN 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
10RUN 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/
15RUN /tmp/skia/skia/modules/pathkit/compile.sh
16
17# CanvasKit should be in /tmp/skia/skia/out/canvaskit_wasm
Kevin Lubick3f67f412019-03-11 16:11:58 -040018RUN /tmp/skia/skia/modules/canvaskit/compile.sh
Kevin Lubick70273a92018-11-07 11:32:50 -050019
Nathaniel Nifong036503b2019-04-01 15:00:57 -040020# Debugger should be in /tmp/skia/skia/out/debugger_wasm
21RUN /tmp/skia/skia/experimental/wasm-skp-debugger/compile.sh
22
Kevin Lubick70273a92018-11-07 11:32:50 -050023RUN cd /tmp/skia/skia && git rev-parse HEAD > /tmp/VERSION
24
25#############################################################################
26# Multi-stage build part 2, in which we only have the compiled results and
27# a VERSION in /tmp
28# See https://docs.docker.com/develop/develop-images/multistage-build/
29#############################################################################
30
31FROM alpine:latest
32
33WORKDIR /tmp/
34
35RUN mkdir /tmp/pathkit /tmp/canvaskit
36
37COPY --from=builder /tmp/VERSION /tmp/VERSION
38
39COPY --from=builder /tmp/skia/skia/out/pathkit/pathkit* /tmp/pathkit/
40
41COPY --from=builder /tmp/skia/skia/out/canvaskit_wasm/canvaskit* /tmp/canvaskit/
Nathaniel Nifong036503b2019-04-01 15:00:57 -040042
43COPY --from=builder /tmp/skia/skia/out/debugger_wasm/debugger* /tmp/debugger/