commit 557a83a1d24f9e115dd7c8095992da3d4cd1260d Author: Alexis Lahouze Date: Sun Nov 4 03:49:15 2018 +0100 Repo init. diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..b67e825 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,24 @@ +# name the portage image +FROM gentoo/portage:latest as portage + +# image is based on stage3-amd64 +FROM gentoo/stage3-amd64:latest as stage3 + +# copy the entire portage volume in +COPY --from=portage /usr/portage /usr/portage + +ARG MAKEOPTS +ARG EMERGE_OPTS=-qv + +# Install needed packages +RUN MAKEOPTS=$MAKEOPTS emerge $EMERGE_OPTS dev-util/catalyst + +COPY stage3-preclean-chroot.sh /usr/share/catalyst/targets/stage3/stage3-preclean-chroot.sh +COPY stage4-chroot.sh /usr/share/catalyst/targets/stage4/stage4-chroot.sh + +VOLUME /var/lib/catalyst +VOLUME /var/cache/portage/distfiles +VOLUME /var/cache/portage/packages + +COPY entrypoint.sh entrypoint.sh +CMD /entrypoint.sh diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100755 index 0000000..ab74042 --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +die() { + echo $* >&2 + exit 1 +} + +export SHELL=/bin/bash +export PYTHON=python + +# Download latest portage snapshot +wget -O /var/lib/catalyst/store/snapshots/portage-latest.tar.bz2 \ + https://gentoo.osuosl.org/releases/snapshots/current/portage-latest.tar.bz2 + +# Update stage3 snapshot +catalyst -c /var/lib/catalyst/catalyst.conf \ + -f /var/lib/catalyst/stage3.spec -a + +# Update custom packages +catalyst -c /var/lib/catalyst/catalyst.conf \ + -f /var/lib/catalyst/build.spec + +# Copy distfiles to web directory +rsync -avug /var/lib/catalyst/store/packages/default/stage3-amd64/ \ + /var/cache/portage/packages/ diff --git a/stage3-preclean-chroot.sh b/stage3-preclean-chroot.sh new file mode 100644 index 0000000..75916ab --- /dev/null +++ b/stage3-preclean-chroot.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +export RUN_DEFAULT_FUNCS="no" + +source /tmp/chroot-functions.sh + +perl-cleaner --reallyall + +update_env_settings +show_debug + +cleanup_stages + +if [ -n "${clst_DISTCC}" ] +then + portageq has_version / sys-devel/distcc + if [ $? == 0 ]; then + run_merge -C sys-devel/distcc || exit 1 + fi +fi + +if [ -n "${clst_ICECREAM}" ] +then + run_merge -C sys-devel/icecream || exit 1 +fi diff --git a/stage4-chroot.sh b/stage4-chroot.sh new file mode 100644 index 0000000..caa9460 --- /dev/null +++ b/stage4-chroot.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +source /tmp/chroot-functions.sh + +export SHELL=/bin/bash +export PYTHON=python + +## START BUILD +setup_pkgmgr + +echo "Bringing system up to date using profile specific use flags" +run_merge -u @system + +echo "Emerging packages using stage4 use flags" + +run_merge "${clst_packages}" +