Repo init.

This commit is contained in:
Alexis Lahouze 2018-11-04 03:49:15 +01:00 committed by root
commit 557a83a1d2
4 changed files with 91 additions and 0 deletions

24
Dockerfile Normal file
View File

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

25
entrypoint.sh Executable file
View File

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

25
stage3-preclean-chroot.sh Normal file
View File

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

17
stage4-chroot.sh Normal file
View File

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