2020-05-02 04:42:24 +02:00
|
|
|
# Portage tree.
|
|
|
|
FROM gentoo/portage:latest as portage
|
|
|
|
|
|
|
|
# Build packages in /workdir.
|
|
|
|
FROM gentoo/stage3-amd64:latest as build
|
|
|
|
COPY --from=portage /var/db/repos/gentoo /var/db/repos/gentoo
|
|
|
|
RUN sed -i 's/-O2/-Os/' /etc/portage/make.conf
|
|
|
|
RUN echo -e '\n# Added by tastytea/gentoo-base:' >> /etc/portage/make.conf
|
|
|
|
# Bug 680456.
|
|
|
|
RUN echo 'FEATURES="-ipc-sandbox -mount-sandbox -network-sandbox -pid-sandbox \
|
2020-05-03 01:56:58 +02:00
|
|
|
-sandbox -usersandbox nodoc noinfo noman"' >> /etc/portage/make.conf
|
2020-05-02 04:42:24 +02:00
|
|
|
RUN echo 'MAKEOPTS="-j1"' >> /etc/portage/make.conf
|
2020-05-05 01:06:34 +02:00
|
|
|
RUN echo 'USE="minimal -berkdb -cracklib -gdbm -gpg -ncurses -nls \
|
|
|
|
-pam -pcre -pcre-jit -perl -readline -rsync-verify -xattr"' \
|
|
|
|
>> /etc/portage/make.conf
|
2020-05-02 04:42:24 +02:00
|
|
|
RUN eselect profile set default/linux/amd64/17.1
|
2020-05-02 23:14:52 +02:00
|
|
|
RUN quickpkg --include-config=y @world sys-libs/glibc
|
2020-05-03 02:03:10 +02:00
|
|
|
RUN emerge --root=/workdir --buildpkg=y --usepkg --quiet sys-apps/portage
|
2020-05-02 04:42:24 +02:00
|
|
|
RUN cp /etc/portage/make.conf /workdir/etc/portage/make.conf
|
2020-05-03 04:20:57 +02:00
|
|
|
RUN rm -r /workdir/usr/share/{i18n,locale,zoneinfo}
|
2020-05-02 04:42:24 +02:00
|
|
|
|
|
|
|
# Final image.
|
|
|
|
FROM scratch
|
|
|
|
LABEL maintainer="tastytea+docker@tastytea.de"
|
2020-05-02 23:14:52 +02:00
|
|
|
LABEL description="My base for Gentoo images (Without build dependencies)."
|
2020-05-02 04:42:24 +02:00
|
|
|
COPY --from=build /workdir /
|
2020-05-02 23:14:52 +02:00
|
|
|
RUN echo 'portage:x:250:250:portage:/var/tmp/portage:/bin/false' >> /etc/passwd
|
|
|
|
RUN echo 'portage::250:portage' >> /etc/group
|