Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
Build docker in parallel
Browse files Browse the repository at this point in the history
  • Loading branch information
saraedum committed Aug 20, 2019
1 parent 497077d commit 155e3ac
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@
# takes about five minutes but you don't have to go through the sadly frequent #
# rebuilds the whole Sage distribution... #
# To build Sage, run this command from your sage/ directory: #
# $ docker build --build-arg MAKEOPTS="-j4" --build-arg SAGE_NUM_THREADS="4" --build-arg ARTIFACT_BASE="sagemath/sagemath-dev:develop" -f docker/Dockerfile --target=make-build --tag sage .
# $ docker build --build-arg MAKEFLAGS="-j4" --build-arg SAGE_NUM_THREADS="4" --build-arg ARTIFACT_BASE="sagemath/sagemath-dev:develop" -f docker/Dockerfile --target=make-build --tag sage .
# To run Sage: #
# $ docker run -it sage #
# To run doctests: #
# $ docker run -e "MAKEOPTS=-j4" -e "SAGE_NUM_THREADS=4" -it sage sage -tp src/sage
# $ docker run -e "MAKEFLAGS=-j4" -e "SAGE_NUM_THREADS=4" -it sage sage -tp src/sage
# Make sure that you always have the latest develop branch merged into your #
# local branch for this to work. #
################################################################################
Expand Down Expand Up @@ -160,13 +160,13 @@ ENV SAGE_FAT_BINARY yes
# Just to be sure Sage doesn't try to build its own GCC (even though
# it shouldn't with a recent GCC package from the system and with gfortran)
ENV SAGE_INSTALL_GCC no
# Set MAKEOPTS and SAGE_NUM_THREADS to build things in parallel during the
# Set MAKEFLAGS and SAGE_NUM_THREADS to build things in parallel during the
# docker build. Note that these do not leak into the sagemath and sagemath-dev
# images.
ARG WITH_PYTHON=2
ENV WITH_PYTHON $WITH_PYTHON
ARG MAKEOPTS="-j2"
ENV MAKEOPTS $MAKEOPTS
ARG MAKEFLAGS="-j2"
ENV MAKEFLAGS $MAKEFLAGS
ARG SAGE_NUM_THREADS="2"
ENV SAGE_NUM_THREADS $SAGE_NUM_THREADS
RUN make configure
Expand All @@ -181,8 +181,8 @@ FROM make-build as make-all
# os.fork() to spawn an external program which then exceeds easily the
# overcommit limit of the system (no RAM is actually used, but this limit is
# very low because there is not even swap on most CI systems.)
ARG MAKEOPTS_DOCBUILD=$MAKEOPTS
ENV MAKEOPTS_DOCBUILD $MAKEOPTS_DOCBUILD
ARG MAKEFLAGS_DOCBUILD=$MAKEFLAGS
ENV MAKEFLAGS_DOCBUILD $MAKEFLAGS_DOCBUILD
ARG SAGE_NUM_THREADS_DOCBUILD=$SAGE_NUM_THREADS
ENV SAGE_NUM_THREADS_DOCBUILD $SAGE_NUM_THREADS_DOCBUILD
RUN make
Expand Down

0 comments on commit 155e3ac

Please sign in to comment.