Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .github/workflows/push_to_docker_hub.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
name: Build Docker images and push to DockerHub

on:
pull_request:
paths:
- '.github/workflows/push_to_docker_hub.yml'
- 'docker/Dockerfile'
workflow_dispatch:
# Allow to run manually
branches:
- 'develop'
push:
tags:
# Match all release tags including beta, rc
Expand Down
24 changes: 12 additions & 12 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ ARG MAKE_BUILD=make-build
FROM ubuntu:jammy AS run-time-dependencies
LABEL maintainer="Erik M. Bray <[email protected]>, Julian Rüth <[email protected]>, Sebastian Oehms <[email protected]>"
# Set sane defaults for common environment variables.
ENV LC_ALL C.UTF-8
ENV LANG C.UTF-8
ENV SHELL /bin/bash
ENV LC_ALL=C.UTF-8
ENV LANG=C.UTF-8
ENV SHELL=/bin/bash
# Create symlinks for sage and sagemath - we copy a built sage to the target of these symlinks later.
ARG SAGE_ROOT=/home/sage/sage
RUN ln -s "$SAGE_ROOT/sage" /usr/bin/sage
Expand All @@ -90,7 +90,7 @@ RUN ln -s /usr/bin/sage /usr/bin/sagemath
# We need gcc/g++ and libstdc++-10-dev to allow compilation of cython at run-time from the notebook.
# We also install sudo for the sage user, see below.
RUN apt-get -qq update \
&& apt-get -qq install -y --no-install-recommends gfortran gcc g++ libstdc++-10-dev sudo openssl bzip2 libbz2-dev pkg-config\
&& apt-get -qq install -y --no-install-recommends gfortran gcc g++ libstdc++-10-dev sudo openssl pkg-config patch libz-dev libbz2-dev bzip2 ca-certificates perl \
&& apt-get -qq clean \
&& rm -r /var/lib/apt/lists/*
# Sage refuses to build as root, so we add a "sage" user that can sudo without a password.
Expand All @@ -101,7 +101,7 @@ RUN adduser --quiet --shell /bin/bash --gecos "Sage user,101,," --disabled-passw
&& chmod 0440 /etc/sudoers.d/01-sage
# Run everything from now on as the sage user in sage's home
USER sage
ENV HOME $HOME
ENV HOME=$HOME
WORKDIR $HOME

################################################################################
Expand All @@ -111,7 +111,7 @@ WORKDIR $HOME
FROM run-time-dependencies AS build-time-dependencies
# Install the build time dependencies & git & rdfind
RUN sudo apt-get -qq update \
&& sudo apt-get -qq install -y wget build-essential automake m4 dpkg-dev python3 libssl-dev git rdfind \
&& sudo apt-get -qq install -y wget build-essential automake m4 dpkg-dev python3 libssl-dev git rdfind autoconf automake libtool bc binutils \
&& sudo apt-get -qq clean \
&& sudo rm -r /var/lib/apt/lists/*

Expand Down Expand Up @@ -185,17 +185,17 @@ RUN patch -p1 < "$HOME"/sage-context.patch
################################################################################
FROM source-from-context AS make-build
# Make sure that the result runs on most CPUs.
ENV SAGE_FAT_BINARY yes
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
ENV SAGE_INSTALL_GCC=no
# 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 MAKEFLAGS="-j2"
ENV MAKEFLAGS $MAKEFLAGS
ENV MAKEFLAGS=$MAKEFLAGS
ARG SAGE_NUM_THREADS="2"
ENV SAGE_NUM_THREADS $SAGE_NUM_THREADS
ENV SAGE_NUM_THREADS=$SAGE_NUM_THREADS
RUN make configure
# Old default before https://github.com/sagemath/sage/issues/32406
RUN ./configure --disable-editable
Expand All @@ -210,9 +210,9 @@ FROM $MAKE_BUILD AS make-all
# 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 MAKEFLAGS_DOCBUILD=$MAKEFLAGS
ENV MAKEFLAGS_DOCBUILD $MAKEFLAGS_DOCBUILD
ENV MAKEFLAGS_DOCBUILD=$MAKEFLAGS_DOCBUILD
ARG SAGE_NUM_THREADS_DOCBUILD=$SAGE_NUM_THREADS
ENV SAGE_NUM_THREADS $SAGE_NUM_THREADS_DOCBUILD
ENV SAGE_NUM_THREADS=$SAGE_NUM_THREADS_DOCBUILD
RUN make

################################################################################
Expand Down
Loading