Browse Source

ci: Add an image for Python 2 on Debian 10

Debian 12 no longer packages Python 2, so we test Python 2 find
modules on an older version.
Brad King 2 years ago
parent
commit
07f42b3690

+ 27 - 0
.gitlab/ci/docker/debian10-x86_64/Dockerfile

@@ -0,0 +1,27 @@
+# syntax=docker/dockerfile:1
+
+ARG BASE_IMAGE=debian:10
+
+FROM ${BASE_IMAGE} AS apt-cache
+# Populate APT cache w/ the fresh metadata and prefetch packages.
+# Use an empty `docker-clean` file to "hide" the image-provided
+# file to disallow removing packages after `apt-get` operations.
+RUN --mount=type=tmpfs,target=/var/log \
+    --mount=type=bind,source=docker-clean,target=/etc/apt/apt.conf.d/docker-clean \
+    --mount=type=bind,source=deps_packages.lst,target=/root/deps_packages.lst \
+    apt-get update \
+ && apt-get --download-only -y install $(grep -h '^[^#]\+$' /root/*.lst)
+
+
+FROM ${BASE_IMAGE}
+LABEL maintainer="Brad King <[email protected]>"
+
+RUN --mount=type=bind,source=install_deps.sh,target=/root/install_deps.sh \
+    --mount=type=bind,source=deps_packages.lst,target=/root/deps_packages.lst \
+    --mount=type=bind,source=dpkg-exclude,target=/etc/dpkg/dpkg.cfg.d/exclude \
+    --mount=type=bind,source=docker-clean,target=/etc/apt/apt.conf.d/docker-clean \
+    --mount=type=cache,from=apt-cache,source=/var/lib/apt/lists,target=/var/lib/apt/lists \
+    --mount=type=cache,from=apt-cache,source=/var/cache/apt,target=/var/cache/apt,sharing=private \
+    --mount=type=tmpfs,target=/var/log \
+    --mount=type=tmpfs,target=/tmp \
+    sh /root/install_deps.sh

+ 16 - 0
.gitlab/ci/docker/debian10-x86_64/deps_packages.lst

@@ -0,0 +1,16 @@
+# Install build requirements.
+libssl-dev
+
+# Install development tools.
+g++
+curl
+git
+
+# Tools needed for the test suite.
+jq
+
+# Packages needed to test find modules.
+python2 python2-dev python-numpy pypy pypy-dev
+
+# CMake_TEST_FindPython2_IronPython
+libmono-system-windows-forms4.0-cil

+ 0 - 0
.gitlab/ci/docker/debian10-x86_64/docker-clean


+ 21 - 0
.gitlab/ci/docker/debian10-x86_64/dpkg-exclude

@@ -0,0 +1,21 @@
+# Drop all man pages
+path-exclude=/usr/share/man/*
+
+# Drop all info pages
+path-exclude=/usr/share/info/*
+
+# Drop all README files except from the some packages
+path-exclude=/usr/**/*README*
+path-include=/usr/share/devscripts/templates/README.mk-build-deps
+path-include=/usr/share/equivs/template/debian/README.Debian.in
+
+# Drop all translations
+path-exclude=/usr/share/locale/*/LC_MESSAGES/*.mo
+
+# Drop all documentation ...
+path-exclude=/usr/share/doc/*
+path-exclude=/usr/share/doc-base/*
+path-exclude=/usr/share/gtk-doc/*
+
+# Per package excludes
+path-exclude=/usr/share/gnupg/help.*.txt

+ 11 - 0
.gitlab/ci/docker/debian10-x86_64/install_deps.sh

@@ -0,0 +1,11 @@
+#!/bin/sh
+
+set -e
+
+apt-get install -y $(grep '^[^#]\+$' /root/deps_packages.lst)
+
+curl -L -O https://github.com/IronLanguages/ironpython2/releases/download/ipy-2.7.12/ironpython_2.7.12.deb
+echo 'b7b90c82cf311dd3faf290ce3f274af5128b96db884a88dd643ce141bbf12fb9  ironpython_2.7.12.deb' > ironpython.sha256sum
+sha256sum --check ironpython.sha256sum
+dpkg -i ironpython_2.7.12.deb
+rm ironpython_2.7.12.deb ironpython.sha256sum