1*c8dee2aaSAndroid Build Coastguard Worker# Docker 2*c8dee2aaSAndroid Build Coastguard Worker 3*c8dee2aaSAndroid Build Coastguard WorkerDocker files for building different Skia targets. 4*c8dee2aaSAndroid Build Coastguard Worker 5*c8dee2aaSAndroid Build Coastguard Worker## skia-release 6*c8dee2aaSAndroid Build Coastguard Worker 7*c8dee2aaSAndroid Build Coastguard WorkerThis image is used to build Skia at TOT with SwiftShader. 8*c8dee2aaSAndroid Build Coastguard Worker 9*c8dee2aaSAndroid Build Coastguard WorkerThere is a continuous process that builds this docker image, but if you 10*c8dee2aaSAndroid Build Coastguard Workerneed to manually push a verison, then run the following commands: 11*c8dee2aaSAndroid Build Coastguard Worker 12*c8dee2aaSAndroid Build Coastguard Worker docker build -t skia-release ./docker/skia-release/ 13*c8dee2aaSAndroid Build Coastguard Worker docker tag skia-release gcr.io/skia-public/skia-release:prod 14*c8dee2aaSAndroid Build Coastguard Worker docker push gcr.io/skia-public/skia-release:prod 15*c8dee2aaSAndroid Build Coastguard Worker 16*c8dee2aaSAndroid Build Coastguard Worker## skia-wasm-release 17*c8dee2aaSAndroid Build Coastguard Worker 18*c8dee2aaSAndroid Build Coastguard WorkerThis image is used to build the Web Assembly (WASM) libraries of Skia 19*c8dee2aaSAndroid Build Coastguard Workerat TOT. 20*c8dee2aaSAndroid Build Coastguard Worker 21*c8dee2aaSAndroid Build Coastguard WorkerThere is a continuous process that builds this docker image, but if you 22*c8dee2aaSAndroid Build Coastguard Workerneed to manually push a verison, then run the following commands: 23*c8dee2aaSAndroid Build Coastguard Worker 24*c8dee2aaSAndroid Build Coastguard Worker docker build -t skia-wasm-release ./docker/skia-wasm-release/ 25*c8dee2aaSAndroid Build Coastguard Worker docker tag skia-wasm-release gcr.io/skia-public/skia-wasm-release:prod 26*c8dee2aaSAndroid Build Coastguard Worker docker push gcr.io/skia-public/skia-wasm-release:prod 27*c8dee2aaSAndroid Build Coastguard Worker 28*c8dee2aaSAndroid Build Coastguard Worker 29*c8dee2aaSAndroid Build Coastguard Worker## skia-with-swift-shader-base 30*c8dee2aaSAndroid Build Coastguard Worker 31*c8dee2aaSAndroid Build Coastguard WorkerThis image is used to build a local checkout of Skia with SwiftShader and run the built 32*c8dee2aaSAndroid Build Coastguard Workerexecutables without requiring the SwiftShader be installed on the host. 33*c8dee2aaSAndroid Build Coastguard Worker 34*c8dee2aaSAndroid Build Coastguard WorkerFor example (see build-with-swift-shader-and-run for more info), to reproduce a 35*c8dee2aaSAndroid Build Coastguard Workerfuzzer bug in SwiftShader: 36*c8dee2aaSAndroid Build Coastguard Worker 37*c8dee2aaSAndroid Build Coastguard Worker # First, copy the test case into $SKIA_ROOT, say $SKIA_ROOT/skbug_1234 38*c8dee2aaSAndroid Build Coastguard Worker build-with-swift-shader-and-run "out/with-swift-shader/fuzz -t filter_fuzz -b /skia/skbug_1234" 39*c8dee2aaSAndroid Build Coastguard Worker 40*c8dee2aaSAndroid Build Coastguard WorkerThere is a continuous process that builds this docker image (which only really changes 41*c8dee2aaSAndroid Build Coastguard Workerif SwiftShader is updated), but if you need to manually push a version, then run the 42*c8dee2aaSAndroid Build Coastguard Workerfollowing commands: 43*c8dee2aaSAndroid Build Coastguard Worker 44*c8dee2aaSAndroid Build Coastguard Worker docker build -t skia-with-swift-shader-base ./docker/skia-with-swift-shader-base/ 45*c8dee2aaSAndroid Build Coastguard Worker docker tag skia-with-swift-shader-base gcr.io/skia-public/skia-with-swift-shader-base:prod 46*c8dee2aaSAndroid Build Coastguard Worker docker push gcr.io/skia-public/skia-with-swift-shader-base:prod 47*c8dee2aaSAndroid Build Coastguard Worker 48*c8dee2aaSAndroid Build Coastguard Worker## cmake-release 49*c8dee2aaSAndroid Build Coastguard Worker 50*c8dee2aaSAndroid Build Coastguard WorkerThis image is used to build Skia using CMake. 51*c8dee2aaSAndroid Build Coastguard Worker 52*c8dee2aaSAndroid Build Coastguard WorkerIt gets manually pushed anytime there's an update to the Dockerfile or relevant 53*c8dee2aaSAndroid Build Coastguard Workerinstalled libraries. To push: 54*c8dee2aaSAndroid Build Coastguard Worker 55*c8dee2aaSAndroid Build Coastguard Worker docker build -t cmake-release ./cmake-release/ 56*c8dee2aaSAndroid Build Coastguard Worker docker tag cmake-release gcr.io/skia-public/cmake-release:3.13.1_v2 57*c8dee2aaSAndroid Build Coastguard Worker docker push gcr.io/skia-public/cmake-release:3.13.1_v2 58*c8dee2aaSAndroid Build Coastguard Worker 59*c8dee2aaSAndroid Build Coastguard WorkerFor testing the image locally, the following flow can be helpful: 60*c8dee2aaSAndroid Build Coastguard Worker 61*c8dee2aaSAndroid Build Coastguard Worker docker build -t cmake-release ./cmake-release/ 62*c8dee2aaSAndroid Build Coastguard Worker # Run bash in it to poke around and make sure things are properly 63*c8dee2aaSAndroid Build Coastguard Worker # installed and configured. Also useful to get version of CMake. 64*c8dee2aaSAndroid Build Coastguard Worker docker run -it cmake-release /bin/bash 65*c8dee2aaSAndroid Build Coastguard Worker # Compile Skia in a local checkout with the local image 66*c8dee2aaSAndroid Build Coastguard Worker docker run -v $SKIA_ROOT:/SRC -v /tmp/output:/OUT cmake-release /SRC/infra/cmake/build_skia.sh 67*c8dee2aaSAndroid Build Coastguard Worker 68*c8dee2aaSAndroid Build Coastguard Worker## binary-size 69*c8dee2aaSAndroid Build Coastguard Worker 70*c8dee2aaSAndroid Build Coastguard WorkerThis image is used to build code size tree-maps of Skia 71*c8dee2aaSAndroid Build Coastguard Worker 72*c8dee2aaSAndroid Build Coastguard WorkerIt gets manually pushed anytime there's an update to the Dockerfile or relevant 73*c8dee2aaSAndroid Build Coastguard Workerinstalled libraries. To push: 74*c8dee2aaSAndroid Build Coastguard Worker 75*c8dee2aaSAndroid Build Coastguard Worker docker build -t binary-size ./binary-size/ 76*c8dee2aaSAndroid Build Coastguard Worker docker tag binary-size gcr.io/skia-public/binary-size:v1 77*c8dee2aaSAndroid Build Coastguard Worker docker push gcr.io/skia-public/binary-size:v1 78*c8dee2aaSAndroid Build Coastguard Worker 79*c8dee2aaSAndroid Build Coastguard WorkerFor testing the image locally, the following flow can be helpful: 80*c8dee2aaSAndroid Build Coastguard Worker 81*c8dee2aaSAndroid Build Coastguard Worker docker build -t binary-size ./binary-size/ 82*c8dee2aaSAndroid Build Coastguard Worker # Run bash in it to poke around and make sure things are properly 83*c8dee2aaSAndroid Build Coastguard Worker # installed and configured. 84*c8dee2aaSAndroid Build Coastguard Worker docker run -it binary-size /bin/sh 85*c8dee2aaSAndroid Build Coastguard Worker # analyze exe "skottie_tool" in build directory out/Release 86*c8dee2aaSAndroid Build Coastguard Worker docker run -v $SKIA_ROOT/out/Release:/IN -v /tmp/output:/OUT binary-size /opt/binary_size/src/run_binary_size_analysis.py --library /IN/skottie_tool --destdir /OUT 87*c8dee2aaSAndroid Build Coastguard Worker 88*c8dee2aaSAndroid Build Coastguard Worker## skia-build-tools 89*c8dee2aaSAndroid Build Coastguard Worker 90*c8dee2aaSAndroid Build Coastguard WorkerThis image contains all the tools needed to build Skia. 91*c8dee2aaSAndroid Build Coastguard Worker 92*c8dee2aaSAndroid Build Coastguard WorkerTo push a new version run: 93*c8dee2aaSAndroid Build Coastguard Worker 94*c8dee2aaSAndroid Build Coastguard Worker make push-skia-build-tools