Skip to content

Commit

Permalink
docker/bootstrap: Replace ENV MAKEFLAGS with setting it per command.
Browse files Browse the repository at this point in the history
The ENV version was not working anyway since Docker did single-quote: '-j$(nproc)'

Because of that make saw this string literal and converted it into an (unknown) absurd high number. On my 12 core machine it executed way more jobs in parallel than 12. This change will also fix this.
  • Loading branch information
michael-berlin committed Mar 3, 2016
1 parent 3bbab08 commit c995349
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions docker/bootstrap/Dockerfile.common
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
FROM golang:1.5

# Use all cores for parallel make (load bound to number of cores as well).
ENV MAKEFLAGS -j$(nproc) -l$(nproc)

# Install Vitess build dependencies
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
automake \
Expand Down Expand Up @@ -36,7 +33,8 @@ RUN curl -sL --connect-timeout 10 --retry 3 \
https://bootstrap.pypa.io/get-pip.py | python

# Install PHP modules for running tests
RUN mkdir -p /vt/bin && \
RUN export MAKEFLAGS="-j$(nproc)" && \
mkdir -p /vt/bin && \
curl -sL --connect-timeout 10 --retry 3 \
https://phar.phpunit.de/phpunit-4.8.9.phar > /vt/bin/phpunit && \
chmod +x /vt/bin/phpunit && \
Expand Down Expand Up @@ -87,7 +85,8 @@ COPY travis /vt/src/github.com/youtube/vitess/travis
COPY composer.json composer.lock /vt/src/github.com/youtube/vitess/

# Install gRPC (and protobuf) as root
RUN cd /vt/dist && \
RUN export MAKEFLAGS="-j$(nproc)" && \
cd /vt/dist && \
INSTALL_GRPC_PHP=`php-config --extension-dir` $VTTOP/travis/install_grpc.sh && \
echo 'extension=grpc.so' > /etc/php5/cli/conf.d/20-grpc.ini && \
rm -rf /vt/dist/grpc
Expand Down

0 comments on commit c995349

Please sign in to comment.