Skip to content

Commit 4263cef

Browse files
author
Release Manager
committed
gh-38251: .ci/write-dockerfile.sh, docker/Dockerfile: Fix Docker warning FromAsCasing <!-- ^ 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". --> Newest versions of Docker buildx give a syntax warning https://github.com/sagemath/sage/actions/runs/9605919331/job/26494464435 ?pr=38227#step:13:194 ``` WARN: FromAsCasing: 'as' and 'FROM' keywords' casing do not match (line 5) ``` ### :memo: 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. - [ ] 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. ### :hourglass: Dependencies <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - #12345: short description why this is a dependency --> <!-- - #34567: ... --> URL: #38251 Reported by: Matthias Köppe Reviewer(s): Sebastian Oehms, sebastian-oehms
2 parents 0962e0b + b61a9f4 commit 4263cef

File tree

2 files changed

+20
-20
lines changed

2 files changed

+20
-20
lines changed

.ci/write-dockerfile.sh

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ ADD="ADD $__CHOWN"
5555
RUN=RUN
5656
cat <<EOF
5757
ARG BASE_IMAGE=$(eval echo "${FULL_BASE_IMAGE_AND_TAG}")
58-
FROM \${BASE_IMAGE} as with-system-packages
58+
FROM \${BASE_IMAGE} AS with-system-packages
5959
EOF
6060
case $SYSTEM in
6161
debian*|ubuntu*)
@@ -199,7 +199,7 @@ EOF
199199
*)
200200
cat <<EOF
201201
ARG BASE_IMAGE
202-
FROM \${BASE_IMAGE} as with-system-packages
202+
FROM \${BASE_IMAGE} AS with-system-packages
203203
EOF
204204
INSTALL=$(sage-print-system-package-command $SYSTEM install " ")
205205
;;
@@ -268,7 +268,7 @@ fi
268268

269269
cat <<EOF
270270
271-
FROM with-system-packages as bootstrapped
271+
FROM with-system-packages AS bootstrapped
272272
#:bootstrapping:
273273
RUN rm -rf /new /sage/.git
274274
$ADD Makefile VERSION.txt COPYING.txt condarc.yml README.md bootstrap bootstrap-conda configure.ac sage .homebrew-build-env tox.ini Pipfile.m4 .gitignore /new/
@@ -301,7 +301,7 @@ WORKDIR /sage
301301
ARG BOOTSTRAP="${BOOTSTRAP-./bootstrap}"
302302
$RUN sh -x -c "\${BOOTSTRAP}" $ENDRUN $THEN_SAVE_STATUS
303303
304-
FROM bootstrapped as configured
304+
FROM bootstrapped AS configured
305305
#:configuring:
306306
RUN $CHECK_STATUS_THEN mkdir -p logs/pkgs; rm -f config.log; ln -s logs/pkgs/config.log config.log
307307
ARG CONFIGURE_ARGS="${CONFIGURE_ARGS:---enable-build-as-root}"
@@ -317,7 +317,7 @@ EOF
317317
fi
318318
cat <<EOF
319319
320-
FROM configured as with-base-toolchain
320+
FROM configured AS with-base-toolchain
321321
# We first compile base-toolchain because otherwise lots of packages are missing their dependency on 'patch'
322322
ARG NUMPROC=8
323323
ENV MAKE="make -j\${NUMPROC}"
@@ -327,7 +327,7 @@ ENV SAGE_CHECK_PACKAGES="!cython,!r,!python3,!gap,!cysignals,!linbox,!git,!ppl,!
327327
#:toolchain:
328328
$RUN $CHECK_STATUS_THEN make \${USE_MAKEFLAGS} base-toolchain $ENDRUN $THEN_SAVE_STATUS
329329
330-
FROM with-base-toolchain as with-targets-pre
330+
FROM with-base-toolchain AS with-targets-pre
331331
ARG NUMPROC=8
332332
ENV MAKE="make -j\${NUMPROC}"
333333
ARG USE_MAKEFLAGS="-k V=0"
@@ -337,7 +337,7 @@ ENV SAGE_CHECK_PACKAGES="!cython,!r,!python3,!gap,!cysignals,!linbox,!git,!ppl,!
337337
ARG TARGETS_PRE="all-sage-local"
338338
$RUN $CHECK_STATUS_THEN make SAGE_SPKG="sage-spkg -y -o" \${USE_MAKEFLAGS} \${TARGETS_PRE} $ENDRUN $THEN_SAVE_STATUS
339339
340-
FROM with-targets-pre as with-targets
340+
FROM with-targets-pre AS with-targets
341341
ARG NUMPROC=8
342342
ENV MAKE="make -j\${NUMPROC}"
343343
ARG USE_MAKEFLAGS="-k V=0"
@@ -359,7 +359,7 @@ RUN cd /new && rm -rf .git && \
359359
ARG TARGETS="build"
360360
$RUN $CHECK_STATUS_THEN make SAGE_SPKG="sage-spkg -y -o" \${USE_MAKEFLAGS} \${TARGETS} $ENDRUN $THEN_SAVE_STATUS
361361
362-
FROM with-targets as with-targets-optional
362+
FROM with-targets AS with-targets-optional
363363
ARG NUMPROC=8
364364
ENV MAKE="make -j\${NUMPROC}"
365365
ARG USE_MAKEFLAGS="-k V=0"

docker/Dockerfile

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ ARG MAKE_BUILD=make-build
7575
################################################################################
7676
# Image containing the run-time dependencies for Sage #
7777
################################################################################
78-
FROM ubuntu:jammy as run-time-dependencies
78+
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.
8181
ENV LC_ALL C.UTF-8
@@ -108,7 +108,7 @@ WORKDIR $HOME
108108
# Image containing everything so that a make in a clone of the Sage repository #
109109
# completes without errors #
110110
################################################################################
111-
FROM run-time-dependencies as build-time-dependencies
111+
FROM run-time-dependencies AS build-time-dependencies
112112
# Install the build time dependencies & git & rdfind
113113
RUN sudo apt-get -qq update \
114114
&& sudo apt-get -qq install -y wget build-essential automake m4 dpkg-dev python3 libssl-dev git rdfind \
@@ -118,7 +118,7 @@ RUN sudo apt-get -qq update \
118118
################################################################################
119119
# Image with an empty git repository in $SAGE_ROOT. #
120120
################################################################################
121-
FROM build-time-dependencies as source-clean
121+
FROM build-time-dependencies AS source-clean
122122
ARG SAGE_ROOT=/home/sage/sage
123123
RUN mkdir -p "$SAGE_ROOT"
124124
WORKDIR $SAGE_ROOT
@@ -135,7 +135,7 @@ RUN git remote add upstream https://github.com/sagemath/sage.git
135135
# build is not going to use the build-time-dependencies target but rely on #
136136
# whatever tools are installed in ARTIFACT_BASE. #
137137
################################################################################
138-
FROM $ARTIFACT_BASE as source-from-context
138+
FROM $ARTIFACT_BASE AS source-from-context
139139
WORKDIR $HOME
140140
COPY --chown=sage:sage . sage-context
141141
# Checkout the commit that is checked out in $HOME/sage-context
@@ -183,7 +183,7 @@ RUN patch -p1 < "$HOME"/sage-context.patch
183183
################################################################################
184184
# Image with a built sage but without sage's documentation. #
185185
################################################################################
186-
FROM source-from-context as make-build
186+
FROM source-from-context AS make-build
187187
# Make sure that the result runs on most CPUs.
188188
ENV SAGE_FAT_BINARY yes
189189
# Just to be sure Sage doesn't try to build its own GCC (even though
@@ -204,7 +204,7 @@ RUN make build
204204
################################################################################
205205
# Image with a full build of sage and its documentation. #
206206
################################################################################
207-
FROM $MAKE_BUILD as make-all
207+
FROM $MAKE_BUILD AS make-all
208208
# The docbuild needs quite some RAM (as of May 2018). It sometimes calls
209209
# os.fork() to spawn an external program which then exceeds easily the
210210
# overcommit limit of the system (no RAM is actually used, but this limit is
@@ -218,15 +218,15 @@ RUN make
218218
################################################################################
219219
# Image with a full build of sage, ready to release. #
220220
################################################################################
221-
FROM make-all as make-release
221+
FROM make-all AS make-release
222222
RUN make micro_release
223223

224224
################################################################################
225225
# A releasable (relatively small) image which contains a copy of sage without #
226226
# temporary build artifacts which is set up to start the command line #
227227
# interface if no parameters are passed in. #
228228
################################################################################
229-
FROM run-time-dependencies as sagemath
229+
FROM run-time-dependencies AS sagemath
230230
ARG HOME=/home/sage
231231
ARG SAGE_ROOT=/home/sage/sage
232232
COPY --chown=sage:sage --from=make-release $SAGE_ROOT/ $SAGE_ROOT/
@@ -244,7 +244,7 @@ CMD ["sage"]
244244
# Image with a full build of sage and its documentation but everything #
245245
# stripped that can be quickly rebuild by make. #
246246
################################################################################
247-
FROM make-all as make-fast-rebuild-clean
247+
FROM make-all AS make-fast-rebuild-clean
248248
# Of course, without site-packages/sage, sage does not start but copying/compiling
249249
# them from build/pkgs/sagelib/src/build is very fast.
250250
RUN make fast-rebuild-clean; \
@@ -255,7 +255,7 @@ RUN make fast-rebuild-clean; \
255255
# identical to make-fast-rebuild-clean or contains a "patch" which can be used #
256256
# to upgrade ARTIFACT_BASE to make-fast-rebuild-clean. #
257257
################################################################################
258-
FROM make-fast-rebuild-clean as sagemath-dev-patch
258+
FROM make-fast-rebuild-clean AS sagemath-dev-patch
259259
ARG ARTIFACT_BASE=source-clean
260260
ARG SAGE_ROOT=/home/sage/sage
261261
# Build a patch containing of a tar file which contains all the modified files
@@ -277,12 +277,12 @@ RUN if [ x"$ARTIFACT_BASE" != x"source-clean" ]; then \
277277
# the build artifacts intact so developers can make changes and rebuild #
278278
# quickly #
279279
################################################################################
280-
FROM $ARTIFACT_BASE as sagemath-dev
280+
FROM $ARTIFACT_BASE AS sagemath-dev
281281
ARG SAGE_ROOT=/home/sage/sage
282282
# If docker is backed by aufs, then the following command adds the size of
283283
# ARTIFACT_BASE to the image size. As of mid 2018 this is notably the case with
284284
# the docker instances provided by setup_remote_docker on CircleCI. As a
285-
# result, the sagemath-dev images that are "build-from-latest" are twice as big
285+
# result, the sagemath-dev images that are "build-from-latest" are twice AS big
286286
# as the ones that are build on GitLab:
287287
# https://github.com/moby/moby/issues/6119#issuecomment-268870519
288288
COPY --chown=sage:sage --from=sagemath-dev-patch $SAGE_ROOT $SAGE_ROOT

0 commit comments

Comments
 (0)