From 5411e69b9136702aa3f17572479e8e5f5d3758d6 Mon Sep 17 00:00:00 2001 From: Alexey Neyman Date: Thu, 10 Feb 2022 14:43:30 -0800 Subject: Update the docker containers To avoid proliferation of versions, I suggest the following policy: the oldest LTS release still receiving maintenance updates + the most recent release for distributions that offer LTS releases. For CentOS, this means CentOS7 and CentOS Stream 9 (since CentOS are all "long-term support", this is just the oldest and the newest among currently supported). For Ubuntu, this means Ubuntu 18.04 (previous LTS are in "security fixes only" mode) and Ubuntu 21.10. Recent Ubuntu attempts to be interactive during the configuration of tzdata, required some additional setup. In the common installation script, the logic for handling a configured/built local directory breaks if `gmake` is detected as the make binary; `make distclean` then fails inside the container because not all systems have `gmake` symlink. Remove that attempt of a workaround completely, just require that the host directory is clean. Signed-off-by: Alexey Neyman diff --git a/testing/docker/alpine3.15/Dockerfile b/testing/docker/alpine3.15/Dockerfile new file mode 100644 index 0000000..2315e78 --- /dev/null +++ b/testing/docker/alpine3.15/Dockerfile @@ -0,0 +1,14 @@ +FROM alpine:3.15 +ARG CTNG_UID=1000 +ARG CTNG_GID=1000 +RUN addgroup -g $CTNG_GID ctng +RUN adduser -D -h /home/ctng -G ctng -u $CTNG_UID -s /bin/bash ctng +# Activate community and testing repositories +RUN echo http://dl-cdn.alpinelinux.org/alpine/edge/testing >> /etc/apk/repositories +RUN echo http://dl-cdn.alpinelinux.org/alpine/edge/community >> /etc/apk/repositories +RUN apk update +RUN apk add alpine-sdk wget xz git bash autoconf automake bison flex texinfo help2man gawk libtool ncurses-dev gettext-dev python3-dev rsync +RUN wget -O /sbin/dumb-init https://github.com/Yelp/dumb-init/releases/download/v1.2.5/dumb-init_1.2.5_x86_64 +RUN chmod a+x /sbin/dumb-init +RUN echo 'export PATH=/opt/ctng/bin:$PATH' >> /etc/profile +ENTRYPOINT [ "/sbin/dumb-init", "--" ] diff --git a/testing/docker/alpine3.15/EXPERIMENTAL b/testing/docker/alpine3.15/EXPERIMENTAL new file mode 100644 index 0000000..846c43b --- /dev/null +++ b/testing/docker/alpine3.15/EXPERIMENTAL @@ -0,0 +1,11 @@ +Support for Alpine Linux as a build or host platform is EXPERIMENTAL. Some of +the packages try to compile binaries for the build or the host machine and fail +because they expect certain GLIBC-specific types, etc: Alpine Linux does not +use GNU libc, it uses musl. + +Only the following bug reports will be looked into: +- A sample configuration used to build successfully and no longer does. Identify +the commit ID that builds successfully for you. +- A pull request that fixes the build for any sample on the Alpine Linux. + +All other bug reports against Alpine as a build/host will be summarily closed. diff --git a/testing/docker/alpine3.8/Dockerfile b/testing/docker/alpine3.8/Dockerfile deleted file mode 100644 index 6119f36..0000000 --- a/testing/docker/alpine3.8/Dockerfile +++ /dev/null @@ -1,14 +0,0 @@ -FROM alpine:3.8 -ARG CTNG_UID=1000 -ARG CTNG_GID=1000 -RUN addgroup -g $CTNG_GID ctng -RUN adduser -D -h /home/ctng -G ctng -u $CTNG_UID -s /bin/bash ctng -# Activate community and testing repositories -RUN echo http://dl-cdn.alpinelinux.org/alpine/edge/testing >> /etc/apk/repositories -RUN echo http://dl-cdn.alpinelinux.org/alpine/edge/community >> /etc/apk/repositories -RUN apk update -RUN apk add alpine-sdk wget xz git bash autoconf automake bison flex texinfo help2man gawk libtool ncurses-dev gettext-dev python-dev rsync -RUN wget -O /sbin/dumb-init https://github.com/Yelp/dumb-init/releases/download/v1.2.1/dumb-init_1.2.1_amd64 -RUN chmod a+x /sbin/dumb-init -RUN echo 'export PATH=/opt/ctng/bin:$PATH' >> /etc/profile -ENTRYPOINT [ "/sbin/dumb-init", "--" ] diff --git a/testing/docker/alpine3.8/EXPERIMENTAL b/testing/docker/alpine3.8/EXPERIMENTAL deleted file mode 100644 index 4d4d6d7..0000000 --- a/testing/docker/alpine3.8/EXPERIMENTAL +++ /dev/null @@ -1,11 +0,0 @@ -Support for Alpine Linux as a build or host platform is EXPERIMENTAL. Some of -the packages try to compile binaries for the build or the machine and fail -because they expect certain GLIBC-specific types, etc: Alpine Linux does not -use GNU libc, it uses musl. - -Only the following bug reports will be looked into: -- A sample configuration used to build successfully and no longer does. Identify -the commit ID that builds successfully for you. -- A pull request that fixes the build for any sample on the Alpine Linux. - -All other bug reports against Alpine as a build/host will be summarily closed. diff --git a/testing/docker/archlinux/Dockerfile b/testing/docker/archlinux/Dockerfile index 95b80f1..571f72d 100644 --- a/testing/docker/archlinux/Dockerfile +++ b/testing/docker/archlinux/Dockerfile @@ -6,7 +6,7 @@ RUN pacman -Syu --noconfirm RUN pacman -S --noconfirm base-devel git help2man python unzip wget audit rsync RUN groupadd -g $CTNG_GID ctng RUN useradd -d /home/ctng -m -g $CTNG_GID -u $CTNG_UID -s /bin/bash ctng -RUN wget -O /sbin/dumb-init https://github.com/Yelp/dumb-init/releases/download/v1.2.1/dumb-init_1.2.1_amd64 +RUN wget -O /sbin/dumb-init https://github.com/Yelp/dumb-init/releases/download/v1.2.5/dumb-init_1.2.5_x86_64 RUN chmod a+x /sbin/dumb-init RUN echo 'export PATH=/opt/ctng/bin:$PATH' >> /etc/profile RUN echo 'export MENUCONFIG_COLOR=mono' >> /etc/profile diff --git a/testing/docker/centos-stream9/Dockerfile b/testing/docker/centos-stream9/Dockerfile new file mode 100644 index 0000000..2e6babc --- /dev/null +++ b/testing/docker/centos-stream9/Dockerfile @@ -0,0 +1,11 @@ +FROM quay.io/centos/centos:stream9 +ARG CTNG_UID=1000 +ARG CTNG_GID=1000 +RUN groupadd -g $CTNG_GID ctng +RUN useradd -d /home/ctng -m -g $CTNG_GID -u $CTNG_UID -s /bin/bash ctng +RUN yum install -y autoconf gperf bison file flex texinfo help2man gcc-c++ libtool make patch \ + ncurses-devel python3-devel perl-Thread-Queue bzip2 git wget which xz unzip rsync diffutils +RUN wget -O /sbin/dumb-init https://github.com/Yelp/dumb-init/releases/download/v1.2.5/dumb-init_1.2.5_x86_64 +RUN chmod a+x /sbin/dumb-init +RUN echo 'export PATH=/opt/ctng/bin:$PATH' >> /etc/profile +ENTRYPOINT [ "/sbin/dumb-init", "--" ] diff --git a/testing/docker/centos6/Dockerfile b/testing/docker/centos6/Dockerfile deleted file mode 100644 index 736557b..0000000 --- a/testing/docker/centos6/Dockerfile +++ /dev/null @@ -1,14 +0,0 @@ -FROM centos:6 -ARG CTNG_UID=1000 -ARG CTNG_GID=1000 -RUN groupadd -g $CTNG_GID ctng -RUN useradd -d /home/ctng -m -g $CTNG_GID -u $CTNG_UID -s /bin/bash ctng -RUN yum install -y epel-release -RUN yum install -y autoconf gperf bison flex texinfo help2man gcc-c++ libtool libtool-bin patch \ - ncurses-devel python34-devel perl-Thread-Queue bzip2 git wget xz unzip rsync -RUN wget -O /sbin/dumb-init https://github.com/Yelp/dumb-init/releases/download/v1.2.1/dumb-init_1.2.1_amd64 -RUN chmod a+x /sbin/dumb-init -RUN echo 'export PATH=/opt/ctng/bin:$PATH' >> /etc/profile -# The limits in this file prevent su'ing to ctng user -RUN rm -f /etc/security/limits.d/90-nproc.conf -ENTRYPOINT [ "/sbin/dumb-init", "--" ] diff --git a/testing/docker/centos7/Dockerfile b/testing/docker/centos7/Dockerfile index 7dfe173..a595bb4 100644 --- a/testing/docker/centos7/Dockerfile +++ b/testing/docker/centos7/Dockerfile @@ -7,7 +7,7 @@ RUN yum install -y epel-release RUN yum install -y autoconf gperf bison file flex texinfo help2man gcc-c++ libtool make patch \ ncurses-devel python36-devel perl-Thread-Queue bzip2 git wget which xz unzip rsync RUN ln -sf python36 /usr/bin/python3 -RUN wget -O /sbin/dumb-init https://github.com/Yelp/dumb-init/releases/download/v1.2.1/dumb-init_1.2.1_amd64 +RUN wget -O /sbin/dumb-init https://github.com/Yelp/dumb-init/releases/download/v1.2.5/dumb-init_1.2.5_x86_64 RUN chmod a+x /sbin/dumb-init RUN echo 'export PATH=/opt/ctng/bin:$PATH' >> /etc/profile ENTRYPOINT [ "/sbin/dumb-init", "--" ] diff --git a/testing/docker/common-scripts/ctng-install b/testing/docker/common-scripts/ctng-install index 1efd264..1b635d9 100755 --- a/testing/docker/common-scripts/ctng-install +++ b/testing/docker/common-scripts/ctng-install @@ -1,23 +1,25 @@ #!/bin/bash set -e -# Mounted directory may already be configured - or may not -# even had bootstrapped. +# Mounted directory may already be configured. Trying to install from +# such directory would cause a failure in the container due to mismatch in +# command names/paths detected by configure on the host. +if [ -e /crosstool-ng/Makefile \ + -o -e /crosstool-ng/.build \ + -o -e /crosstool-ng/.build-all \ + -o -e /crosstool-ng/config.status ]; then + echo "ERROR :: The host directory must not be configured/built. Run 'git clean -fxd' before" >&2 + echo "ERROR :: installing crosstool-NG in the container." >&2 + exit 1 +fi tar cf - -C / \ - --exclude=crosstool-ng/.build \ - --exclude=crosstool-ng/.build.all \ --exclude=crosstool-ng/.git \ --exclude=crosstool-ng/testing/docker \ crosstool-ng | \ tar xf - cd crosstool-ng -if [ -r Makefile ]; then - make distclean -elif [ ! -r configure ]; then - ./bootstrap -fi -cd .. -cd work +./bootstrap +cd ../work ~/crosstool-ng/configure --prefix=/opt/ctng make make install diff --git a/testing/docker/dmgr.sh b/testing/docker/dmgr.sh index e6a93e7..2945fbb 100755 --- a/testing/docker/dmgr.sh +++ b/testing/docker/dmgr.sh @@ -37,6 +37,8 @@ Action is one of: enter Spawn a shell in the specified container. root Spawn a root shell in the specified container. clean Clean up in the specified container. + distclean Same as clean but also remove installed versions of + Crosstool-NG and the previously built toolchains. If a special container name 'all' is used, the action is performed on all the containers. @@ -63,7 +65,7 @@ action_build() msg "Cleaning up previous runs for ${cntr}" do_cleanup ${cntr}/{build,install,xtools} msg "Building Docker container for ${cntr}" -set -x + set -x docker build --no-cache -t "ctng-${cntr}" --build-arg CTNG_GID=`id -g` --build-arg CTNG_UID=`id -u` "${cntr}" } @@ -92,8 +94,9 @@ _dckr() $prefix su -l ctng fi if [ $? != 0 ]; then - global_rc=1 + global_rc=1 fi + return $global_rc } # Run the test @@ -105,9 +108,9 @@ action_install() msg "Setting up crosstool-NG in ${cntr}" do_cleanup ${cntr}/build if ! _dckr "${cntr}" /common-scripts/ctng-install; then - warn "Installation failed" + warn "Installation failed" elif ! _dckr "${cntr}" /common-scripts/ctng-test-basic; then - warn "Basic tests failed" + warn "Basic tests failed" fi } diff --git a/testing/docker/fedora29/Dockerfile b/testing/docker/fedora29/Dockerfile deleted file mode 100644 index 9d7293f..0000000 --- a/testing/docker/fedora29/Dockerfile +++ /dev/null @@ -1,11 +0,0 @@ -FROM fedora:29 -ARG CTNG_UID=1000 -ARG CTNG_GID=1000 -RUN groupadd -g $CTNG_GID ctng -RUN useradd -d /home/ctng -m -g $CTNG_GID -u $CTNG_UID -s /bin/bash ctng -RUN yum install -y autoconf gperf bison file flex texinfo help2man gcc-c++ libtool make patch \ - ncurses-devel python3-devel perl-Thread-Queue bzip2 git wget which xz unzip rsync -RUN wget -O /sbin/dumb-init https://github.com/Yelp/dumb-init/releases/download/v1.2.1/dumb-init_1.2.1_amd64 -RUN chmod a+x /sbin/dumb-init -RUN echo 'export PATH=/opt/ctng/bin:$PATH' >> /etc/profile -ENTRYPOINT [ "/sbin/dumb-init", "--" ] diff --git a/testing/docker/fedora35/Dockerfile b/testing/docker/fedora35/Dockerfile new file mode 100644 index 0000000..1ce88f7 --- /dev/null +++ b/testing/docker/fedora35/Dockerfile @@ -0,0 +1,11 @@ +FROM fedora:35 +ARG CTNG_UID=1000 +ARG CTNG_GID=1000 +RUN groupadd -g $CTNG_GID ctng +RUN useradd -d /home/ctng -m -g $CTNG_GID -u $CTNG_UID -s /bin/bash ctng +RUN yum install -y autoconf gperf bison file flex texinfo help2man gcc-c++ libtool make patch \ + ncurses-devel python3-devel perl-Thread-Queue bzip2 git wget which xz unzip rsync diffutils +RUN wget -O /sbin/dumb-init https://github.com/Yelp/dumb-init/releases/download/v1.2.5/dumb-init_1.2.5_x86_64 +RUN chmod a+x /sbin/dumb-init +RUN echo 'export PATH=/opt/ctng/bin:$PATH' >> /etc/profile +ENTRYPOINT [ "/sbin/dumb-init", "--" ] diff --git a/testing/docker/gentoo-amd64/Dockerfile b/testing/docker/gentoo-amd64/Dockerfile index b261cc3..b090c47 100644 --- a/testing/docker/gentoo-amd64/Dockerfile +++ b/testing/docker/gentoo-amd64/Dockerfile @@ -3,7 +3,7 @@ ARG CTNG_UID=1000 ARG CTNG_GID=1000 RUN groupadd -g $CTNG_GID ctng RUN useradd -d /home/ctng -m -g $CTNG_GID -u $CTNG_UID -s /bin/bash ctng -RUN wget -O /sbin/dumb-init https://github.com/Yelp/dumb-init/releases/download/v1.2.1/dumb-init_1.2.1_amd64 +RUN wget -O /sbin/dumb-init https://github.com/Yelp/dumb-init/releases/download/v1.2.5/dumb-init_1.2.5_x86_64 RUN chmod a+x /sbin/dumb-init RUN echo 'export PATH=/opt/ctng/bin:$PATH' >> /etc/profile ENTRYPOINT [ "/sbin/dumb-init", "--" ] diff --git a/testing/docker/mint19-amd64/Dockerfile b/testing/docker/mint19-amd64/Dockerfile deleted file mode 100644 index 61f0562..0000000 --- a/testing/docker/mint19-amd64/Dockerfile +++ /dev/null @@ -1,12 +0,0 @@ -FROM linuxmintd/mint19-amd64 -ARG CTNG_UID=1000 -ARG CTNG_GID=1000 -RUN groupadd -g $CTNG_GID ctng -RUN useradd -d /home/ctng -m -g $CTNG_GID -u $CTNG_UID -s /bin/bash ctng -RUN apt-get update -RUN apt-get install -y gcc gperf bison flex texinfo help2man make libncurses5-dev \ - python3-dev autoconf automake libtool libtool-bin gawk wget rsync -RUN wget -O /sbin/dumb-init https://github.com/Yelp/dumb-init/releases/download/v1.2.1/dumb-init_1.2.1_amd64 -RUN chmod a+x /sbin/dumb-init -RUN echo 'export PATH=/opt/ctng/bin:$PATH' >> /etc/profile -ENTRYPOINT [ "/sbin/dumb-init", "--" ] diff --git a/testing/docker/mint20-amd64/Dockerfile b/testing/docker/mint20-amd64/Dockerfile new file mode 100644 index 0000000..be2ea45 --- /dev/null +++ b/testing/docker/mint20-amd64/Dockerfile @@ -0,0 +1,12 @@ +FROM linuxmintd/mint20-amd64 +ARG CTNG_UID=1000 +ARG CTNG_GID=1000 +RUN groupadd -g $CTNG_GID ctng +RUN useradd -d /home/ctng -m -g $CTNG_GID -u $CTNG_UID -s /bin/bash ctng +RUN apt-get update +RUN apt-get install -y gcc gperf bison flex texinfo help2man make libncurses5-dev \ + python3-dev autoconf automake libtool libtool-bin gawk wget rsync +RUN wget -O /sbin/dumb-init https://github.com/Yelp/dumb-init/releases/download/v1.2.5/dumb-init_1.2.5_x86_64 +RUN chmod a+x /sbin/dumb-init +RUN echo 'export PATH=/opt/ctng/bin:$PATH' >> /etc/profile +ENTRYPOINT [ "/sbin/dumb-init", "--" ] diff --git a/testing/docker/ubuntu16.04/Dockerfile b/testing/docker/ubuntu16.04/Dockerfile deleted file mode 100644 index 4190fc5..0000000 --- a/testing/docker/ubuntu16.04/Dockerfile +++ /dev/null @@ -1,14 +0,0 @@ -FROM ubuntu:16.04 -ARG CTNG_UID=1000 -ARG CTNG_GID=1000 -RUN groupadd -g $CTNG_GID ctng -RUN useradd -d /home/ctng -m -g $CTNG_GID -u $CTNG_UID -s /bin/bash ctng -RUN apt-get update -RUN apt-get install -y gcc g++ gperf bison flex texinfo help2man make libncurses5-dev \ - python3-dev autoconf automake libtool libtool-bin gawk wget bzip2 xz-utils unzip \ - patch libstdc++6 rsync -RUN wget -O /sbin/dumb-init https://github.com/Yelp/dumb-init/releases/download/v1.2.1/dumb-init_1.2.1_amd64 -RUN chmod a+x /sbin/dumb-init -RUN echo 'export PATH=/opt/ctng/bin:$PATH' >> /etc/profile -ENTRYPOINT [ "/sbin/dumb-init", "--" ] - diff --git a/testing/docker/ubuntu18.04/Dockerfile b/testing/docker/ubuntu18.04/Dockerfile index f5156d2..8adc186 100644 --- a/testing/docker/ubuntu18.04/Dockerfile +++ b/testing/docker/ubuntu18.04/Dockerfile @@ -7,7 +7,7 @@ RUN apt-get update RUN apt-get install -y gcc g++ gperf bison flex texinfo help2man make libncurses5-dev \ python3-dev autoconf automake libtool libtool-bin gawk wget bzip2 xz-utils unzip \ patch libstdc++6 rsync -RUN wget -O /sbin/dumb-init https://github.com/Yelp/dumb-init/releases/download/v1.2.1/dumb-init_1.2.1_amd64 +RUN wget -O /sbin/dumb-init https://github.com/Yelp/dumb-init/releases/download/v1.2.5/dumb-init_1.2.5_x86_64 RUN chmod a+x /sbin/dumb-init RUN echo 'export PATH=/opt/ctng/bin:$PATH' >> /etc/profile ENTRYPOINT [ "/sbin/dumb-init", "--" ] diff --git a/testing/docker/ubuntu19.10/Dockerfile b/testing/docker/ubuntu19.10/Dockerfile deleted file mode 100644 index 0c39ffc..0000000 --- a/testing/docker/ubuntu19.10/Dockerfile +++ /dev/null @@ -1,14 +0,0 @@ -FROM ubuntu:19.10 -ARG CTNG_UID=1000 -ARG CTNG_GID=1000 -RUN groupadd -g $CTNG_GID ctng -RUN useradd -d /home/ctng -m -g $CTNG_GID -u $CTNG_UID -s /bin/bash ctng -RUN apt-get update -RUN apt-get install -y gcc g++ gperf bison flex texinfo help2man make libncurses5-dev \ - python3-dev autoconf automake libtool libtool-bin gawk wget bzip2 xz-utils unzip \ - patch libstdc++6 rsync git -RUN wget -O /sbin/dumb-init https://github.com/Yelp/dumb-init/releases/download/v1.2.1/dumb-init_1.2.1_amd64 -RUN chmod a+x /sbin/dumb-init -RUN echo 'export PATH=/opt/ctng/bin:$PATH' >> /etc/profile -ENTRYPOINT [ "/sbin/dumb-init", "--" ] - diff --git a/testing/docker/ubuntu21.10/Dockerfile b/testing/docker/ubuntu21.10/Dockerfile new file mode 100644 index 0000000..883a26d --- /dev/null +++ b/testing/docker/ubuntu21.10/Dockerfile @@ -0,0 +1,20 @@ +FROM ubuntu:21.10 +ARG CTNG_UID=1000 +ARG CTNG_GID=1000 +RUN groupadd -g $CTNG_GID ctng +RUN useradd -d /home/ctng -m -g $CTNG_GID -u $CTNG_UID -s /bin/bash ctng + +# Non-interactive configuration of tzdata +ENV DEBIAN_FRONTEND noninteractive +ENV DEBCONF_NONINTERACTIVE_SEEN true +RUN { echo 'tzdata tzdata/Areas select Etc'; echo 'tzdata tzdata/Zones/Etc select UTC'; } | debconf-set-selections + +RUN apt-get update +RUN apt-get install -y gcc g++ gperf bison flex texinfo help2man make libncurses5-dev \ + python3-dev autoconf automake libtool libtool-bin gawk wget bzip2 xz-utils unzip \ + patch libstdc++6 rsync git +RUN wget -O /sbin/dumb-init https://github.com/Yelp/dumb-init/releases/download/v1.2.5/dumb-init_1.2.5_x86_64 +RUN chmod a+x /sbin/dumb-init +RUN echo 'export PATH=/opt/ctng/bin:$PATH' >> /etc/profile +ENTRYPOINT [ "/sbin/dumb-init", "--" ] + -- cgit v0.10.2-6-g49f6