This repository has been archived on 2024-01-20. You can view files and clone it, but cannot push or open issues or pull requests.
gentoo-binpkg-builder/Dockerfile

50 lines
2.0 KiB
Docker
Raw Permalink Normal View History

# SPDX-License-Identifier: MIT
# Author: Nils Freydank <nils.freydank@posteo.de>
#
# ===========================================================================
# Update the source image.
# ===========================================================================
2023-10-01 21:10:07 +02:00
FROM scratch as bootstrap
# Unpack the stage3 archive (which is downloaded and verifed externally).
ARG ROOTFS_FILENAME=""
ADD ${ROOTFS_FILENAME} /
2023-10-01 21:10:07 +02:00
# Set the profile.
RUN eselect profile set "default/linux/amd64/17.1/no-multilib/systemd/merged-usr"
# Replace /etc/portage/make.conf.
RUN rm --one-file-system /etc/portage/make.conf
COPY make.conf /etc/portage/make.conf
RUN chown root:root -R /etc/portage/make.conf
2023-07-15 20:52:26 +02:00
# Add overlays in /var/db/repos.
COPY repos.conf /etc/portage/repos.conf
RUN chown root:root -R /etc/portage/make.conf
2023-08-31 22:13:26 +02:00
# Update the compiler and glibc. Switch to the new gcc then and print the version.
RUN emerge --oneshot --usepkg sys-devel/gcc:13 sys-libs/glibc
RUN eselect gcc set x86_64-pc-linux-gnu-13 && source /etc/profile && gcc --version
# Update libtool after the compiler update.
RUN emerge --oneshot sys-devel/libtool
# Rebuild the whole world set, probably mostly with binpkgs.
RUN emerge --emptytree --verbose --usepkg @world
# Install further toolchains
RUN emerge --usepkg --noreplace dev-lang/rust dev-lang/go \
@rust-rebuild @golang-rebuild
# Rebuild packages if necessary.
RUN emerge @preserved-rebuild
# Fix stuff after perl upgrades
RUN perl-cleaner --reallyall
# ===========================================================================
# Clean up the image.
# ===========================================================================
2023-08-27 19:37:47 +02:00
# Unmerge stuff that is not needed.
RUN emerge --depclean
RUN rm --verbose --recursive --preserve-root /var/tmp/
# ===========================================================================
# Create the new image
# ===========================================================================
FROM scratch
COPY --from=bootstrap / /
# vim:fileencoding=utf-8:ts=4:syntax=dockerfile:expandtab