2023-06-17 20:24:22 +02:00
|
|
|
# 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).
|
2023-10-22 11:17:17 +02:00
|
|
|
ARG ROOTFS_FILENAME=""
|
|
|
|
ADD ${ROOTFS_FILENAME} /
|
2023-10-01 21:10:07 +02:00
|
|
|
# Set the profile.
|
2023-06-17 20:24:22 +02:00
|
|
|
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
|
2023-06-17 20:24:22 +02:00
|
|
|
# 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
|
2023-08-04 20:34:21 +02:00
|
|
|
# Fix stuff after perl upgrades
|
|
|
|
RUN perl-cleaner --reallyall
|
2023-06-17 20:24:22 +02:00
|
|
|
|
|
|
|
# ===========================================================================
|
|
|
|
# Clean up the image.
|
|
|
|
# ===========================================================================
|
2023-08-27 19:37:47 +02:00
|
|
|
# Unmerge stuff that is not needed.
|
|
|
|
RUN emerge --depclean
|
2023-06-17 20:24:22 +02:00
|
|
|
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
|