2020-05-02 23:16:24 +02:00
|
|
|
= Docker images
|
|
|
|
|
|
|
|
My amateurish attempts at creating docker images.
|
|
|
|
|
|
|
|
== tastytea/gentoo-base
|
|
|
|
|
|
|
|
A minimal Gentoo image without build dependencies. I use it as a base for other
|
|
|
|
images, so that I don't have to compile everything from scratch all the time.
|
|
|
|
|
|
|
|
=== Features
|
|
|
|
|
|
|
|
* Replaced `-O2` with `-Os` in `${COMMON_FLAGS}`.
|
|
|
|
* Turned off sandboxing (https://bugs.gentoo.org/680456[Bug 680456]).
|
2020-05-03 02:17:20 +02:00
|
|
|
* Turned off documentation installation.
|
2020-05-02 23:16:24 +02:00
|
|
|
* `MAKEOPTS="-j1"`.
|
|
|
|
* Deactivated some use-flags, added `minimal`.
|
|
|
|
* Packages installed: `sys-apps/portage` + run-time dependencies.
|
|
|
|
* Deleted: Documentation, translations, time zone info.
|
|
|
|
|
|
|
|
=== Example Dockerfile
|
|
|
|
|
|
|
|
[source,docker]
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
# Portage tree.
|
|
|
|
FROM gentoo/portage:latest as portage
|
|
|
|
|
|
|
|
# Minimal Gentoo image without build dependencies.
|
|
|
|
FROM tastytea/gentoo-base:latest as gentoo-base
|
|
|
|
|
|
|
|
# Build packages in /workdir.
|
|
|
|
FROM gentoo/stage3-amd64:latest as build
|
|
|
|
COPY --from=portage /var/db/repos/gentoo /var/db/repos/gentoo
|
|
|
|
COPY --from=gentoo-base / /workdir
|
|
|
|
RUN cp /workdir/etc/portage/make.conf /etc/portage/make.conf
|
|
|
|
RUN eselect profile set default/linux/amd64/17.1
|
2020-05-05 01:04:50 +02:00
|
|
|
RUN mkdir -p /etc/portage/package.accept_keywords
|
2020-05-02 23:16:24 +02:00
|
|
|
RUN echo 'games-misc/cowsay' >> \
|
2020-05-05 01:04:50 +02:00
|
|
|
/etc/portage/package.accept_keywords/cowsay
|
2020-05-03 15:49:50 +02:00
|
|
|
RUN emerge --root=/workdir --buildpkg=y --usepkg --quiet games-misc/cowsay
|
2020-05-02 23:16:24 +02:00
|
|
|
|
|
|
|
# Final image.
|
|
|
|
FROM scratch
|
|
|
|
COPY --from=build /workdir /
|
2020-05-05 02:59:04 +02:00
|
|
|
ENV LANG "en_DK.utf8"
|
2020-05-02 23:16:24 +02:00
|
|
|
--------------------------------------------------------------------------------
|