Split native and cross compilers into two docker images.

This commit is contained in:
Nicolas "Pixel" Noble 2018-05-18 09:22:07 +02:00
parent 94a6fab435
commit 968a706a89
4 changed files with 38 additions and 7 deletions

View File

@ -20,6 +20,21 @@ npm install -g npm
# https://github.com/mapbox/node-pre-gyp/issues/362
npm install -g node-gyp
DO_NATIVE=true
DO_CROSS=true
while [ $# -gt 0 ] ; do
case $1 in
--native-only)
DO_CROSS=false
;;
--cross-only)
DO_NATIVE=false
;;
esac
shift
done
set -ex
cd $(dirname $0)
@ -34,10 +49,13 @@ rm -rf build || true
mkdir -p "${ARTIFACTS_OUT}"
docker build -t alpine_node_artifact $base_dir/tools/docker/alpine_artifact
if [ "$DO_NATIVE" = "true" ] ; then
$tool_dir/build_artifact_node.sh
fi
$tool_dir/build_artifact_node.sh
if [ "$DO_CROSS" = "true" ] ; then
$tool_dir/build_artifact_node_arm.sh
$tool_dir/build_artifact_node_arm.sh
docker run -e JOBS=8 -e ARTIFACTS_OUT=/var/grpc/artifacts -v $base_dir:/var/grpc alpine_node_artifact /var/grpc/tools/run_tests/artifacts/build_artifact_node.sh --with-alpine
docker build -t alpine_node_artifact $base_dir/tools/docker/alpine_artifact
docker run -e JOBS=8 -e ARTIFACTS_OUT=/var/grpc/artifacts -v $base_dir:/var/grpc alpine_node_artifact /var/grpc/tools/run_tests/artifacts/build_artifact_node.sh --with-alpine
fi

View File

@ -38,8 +38,11 @@ OS=`uname`
case $OS in
Linux)
docker build -t kokoro-image tools/release/kokoro
docker run -v /var/run/docker.sock:/var/run/docker.sock -v $base_dir:$base_dir kokoro-image $base_dir/packages/grpc-native-core/tools/run_tests/artifacts/build_all_linux_artifacts.sh
docker build -t kokoro-native-image tools/release/native
docker build -t kokoro-cross-image tools/release/cross
docker run -v /var/run/docker.sock:/var/run/docker.sock -v $base_dir:$base_dir kokoro-native-image $base_dir/packages/grpc-native-core/tools/run_tests/artifacts/build_all_linux_artifacts.sh --native-only
cp -rv packages/grpc-native-core/artifacts .
docker run -v /var/run/docker.sock:/var/run/docker.sock -v $base_dir:$base_dir kokoro-cross-image $base_dir/packages/grpc-native-core/tools/run_tests/artifacts/build_all_linux_artifacts.sh --cross-only
cp -rv packages/grpc-native-core/artifacts .
;;
Darwin)

View File

@ -0,0 +1,10 @@
FROM debian:jessie
RUN apt-get update
RUN apt-get install -y curl build-essential python libc6-dev-i386 lib32stdc++-4.9-dev
RUN curl -fsSL get.docker.com | bash
RUN mkdir /usr/local/nvm
ENV NVM_DIR /usr/local/nvm
RUN curl curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash