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 <stilor@att.net>
This commit is contained in:
Alexey Neyman 2022-02-10 14:43:30 -08:00
parent a4cff7a061
commit 5411e69b91
13 changed files with 45 additions and 51 deletions

View File

@ -1,4 +1,4 @@
FROM alpine:3.8
FROM alpine:3.15
ARG CTNG_UID=1000
ARG CTNG_GID=1000
RUN addgroup -g $CTNG_GID ctng
@ -7,8 +7,8 @@ RUN adduser -D -h /home/ctng -G ctng -u $CTNG_UID -s /bin/bash ctng
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 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", "--" ]

View File

@ -1,5 +1,5 @@
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
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.

View File

@ -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

View File

@ -1,14 +1,11 @@
FROM ubuntu:16.04
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 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 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", "--" ]

View File

@ -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", "--" ]

View File

@ -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", "--" ]

View File

@ -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

View File

@ -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
}

View File

@ -1,11 +1,11 @@
FROM fedora:29
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
RUN wget -O /sbin/dumb-init https://github.com/Yelp/dumb-init/releases/download/v1.2.1/dumb-init_1.2.1_amd64
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", "--" ]

View File

@ -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", "--" ]

View File

@ -1,4 +1,4 @@
FROM linuxmintd/mint19-amd64
FROM linuxmintd/mint20-amd64
ARG CTNG_UID=1000
ARG CTNG_GID=1000
RUN groupadd -g $CTNG_GID ctng
@ -6,7 +6,7 @@ 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 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", "--" ]

View File

@ -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", "--" ]

View File

@ -1,13 +1,19 @@
FROM ubuntu:19.10
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.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", "--" ]