Skip to content

Commit 1cfd52c

Browse files
author
Release Manager
committed
gh-40708: make sure _prereq etc are installed in the docker images <!-- ^ Please provide a concise and informative title. --> <!-- ^ Don't put issue numbers in the title, do this in the PR description below. --> <!-- ^ For example, instead of "Fixes #12345" use "Introduce new method to calculate 1 + 2". --> <!-- v Describe your changes below in detail. --> <!-- v Why is this change required? What problem does it solve? --> <!-- v If this PR resolves an open issue, please link to it here. For example, "Fixes #12345". --> This is a follow-up to #40460 Docker images need to get _prereqs installed, as noticed in #40460 (comment) ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation and checked the documentation preview. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - #12345: short description why this is a dependency --> <!-- - #34567: ... --> URL: #40708 Reported by: Dima Pasechnik Reviewer(s): Sebastian Oehms, Tobias Diez
2 parents 581ee82 + f752004 commit 1cfd52c

File tree

2 files changed

+16
-14
lines changed

2 files changed

+16
-14
lines changed

.github/workflows/push_to_docker_hub.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
name: Build Docker images and push to DockerHub
22

33
on:
4+
pull_request:
5+
paths:
6+
- '.github/workflows/push_to_docker_hub.yml'
7+
- 'docker/Dockerfile'
48
workflow_dispatch:
59
# Allow to run manually
6-
branches:
7-
- 'develop'
810
push:
911
tags:
1012
# Match all release tags including beta, rc

docker/Dockerfile

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@ ARG MAKE_BUILD=make-build
7878
FROM ubuntu:jammy AS run-time-dependencies
7979
LABEL maintainer="Erik M. Bray <[email protected]>, Julian Rüth <[email protected]>, Sebastian Oehms <[email protected]>"
8080
# Set sane defaults for common environment variables.
81-
ENV LC_ALL C.UTF-8
82-
ENV LANG C.UTF-8
83-
ENV SHELL /bin/bash
81+
ENV LC_ALL=C.UTF-8
82+
ENV LANG=C.UTF-8
83+
ENV SHELL=/bin/bash
8484
# Create symlinks for sage and sagemath - we copy a built sage to the target of these symlinks later.
8585
ARG SAGE_ROOT=/home/sage/sage
8686
RUN ln -s "$SAGE_ROOT/sage" /usr/bin/sage
@@ -90,7 +90,7 @@ RUN ln -s /usr/bin/sage /usr/bin/sagemath
9090
# We need gcc/g++ and libstdc++-10-dev to allow compilation of cython at run-time from the notebook.
9191
# We also install sudo for the sage user, see below.
9292
RUN apt-get -qq update \
93-
&& apt-get -qq install -y --no-install-recommends gfortran gcc g++ libstdc++-10-dev sudo openssl bzip2 libbz2-dev pkg-config\
93+
&& 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 \
9494
&& apt-get -qq clean \
9595
&& rm -r /var/lib/apt/lists/*
9696
# Sage refuses to build as root, so we add a "sage" user that can sudo without a password.
@@ -101,7 +101,7 @@ RUN adduser --quiet --shell /bin/bash --gecos "Sage user,101,," --disabled-passw
101101
&& chmod 0440 /etc/sudoers.d/01-sage
102102
# Run everything from now on as the sage user in sage's home
103103
USER sage
104-
ENV HOME $HOME
104+
ENV HOME=$HOME
105105
WORKDIR $HOME
106106

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

@@ -185,17 +185,17 @@ RUN patch -p1 < "$HOME"/sage-context.patch
185185
################################################################################
186186
FROM source-from-context AS make-build
187187
# Make sure that the result runs on most CPUs.
188-
ENV SAGE_FAT_BINARY yes
188+
ENV SAGE_FAT_BINARY=yes
189189
# Just to be sure Sage doesn't try to build its own GCC (even though
190190
# it shouldn't with a recent GCC package from the system and with gfortran)
191-
ENV SAGE_INSTALL_GCC no
191+
ENV SAGE_INSTALL_GCC=no
192192
# Set MAKEFLAGS and SAGE_NUM_THREADS to build things in parallel during the
193193
# docker build. Note that these do not leak into the sagemath and sagemath-dev
194194
# images.
195195
ARG MAKEFLAGS="-j2"
196-
ENV MAKEFLAGS $MAKEFLAGS
196+
ENV MAKEFLAGS=$MAKEFLAGS
197197
ARG SAGE_NUM_THREADS="2"
198-
ENV SAGE_NUM_THREADS $SAGE_NUM_THREADS
198+
ENV SAGE_NUM_THREADS=$SAGE_NUM_THREADS
199199
RUN make configure
200200
# Old default before https://github.com/sagemath/sage/issues/32406
201201
RUN ./configure --disable-editable
@@ -210,9 +210,9 @@ FROM $MAKE_BUILD AS make-all
210210
# overcommit limit of the system (no RAM is actually used, but this limit is
211211
# very low because there is not even swap on most CI systems.)
212212
ARG MAKEFLAGS_DOCBUILD=$MAKEFLAGS
213-
ENV MAKEFLAGS_DOCBUILD $MAKEFLAGS_DOCBUILD
213+
ENV MAKEFLAGS_DOCBUILD=$MAKEFLAGS_DOCBUILD
214214
ARG SAGE_NUM_THREADS_DOCBUILD=$SAGE_NUM_THREADS
215-
ENV SAGE_NUM_THREADS $SAGE_NUM_THREADS_DOCBUILD
215+
ENV SAGE_NUM_THREADS=$SAGE_NUM_THREADS_DOCBUILD
216216
RUN make
217217

218218
################################################################################

0 commit comments

Comments
 (0)