File: Dockerfile-gentoo

package info (click to toggle)
dracut 110-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 4,356 kB
  • sloc: sh: 24,895; ansic: 5,236; makefile: 346; perl: 186; python: 48; javascript: 19
file content (90 lines) | stat: -rw-r--r-- 3,087 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# Test coverage provided by this container:
# - glibc/systemd or musl/openrc
# - systemd-networkd
# - bash
# - dbus-daemon
# - network (systemd): network-legacy, systemd-networkd
# - network (OpenRC): networkmanager

# Not installed
# - busybox (to increase coverage)
# - dash (to increase coverage)
# - rng-tools (to increase coverage)
# - ntfs3g (to keep container small)
# - xorriso (to keep container small, no .iso generation)

ARG OPTION=systemd

FROM docker.io/gentoo/stage3:${OPTION}

# export ARG
ARG OPTION

RUN \
    # Speed-up using binpkgs \
    echo "MAKEOPTS=\"-j$(nproc) -l$(nproc)\"" >> /etc/portage/make.conf ;\
    echo "EMERGE_DEFAULT_OPTS=\"-j$(nproc) -l$(nproc)\"" >> /etc/portage/make.conf ;\
    echo "FEATURES=\"getbinpkg binpkg-ignore-signature parallel-fetch parallel-install pkgdir-index-trusted\"" >> /etc/portage/make.conf ;\
    # systemd-boot, no need to install intramfs with kernel \
    echo "USE=\"boot kernel-install pkcs7 pkcs11 tpm -initramfs\"" >> /etc/portage/make.conf ;\
    # Use debian's installkernel \
    echo 'sys-kernel/installkernel -systemd' >> /etc/portage/package.use/kernel ;\
    # Enable fido2, ukify, qrcode and cryptsetup (includes unit generator for crypttab) \
    echo 'sys-apps/systemd fido2 ukify qrcode cryptsetup importd curl lzma' >> /etc/portage/package.use/systemd ;\
    # Support thin volumes and build all of LVM2 including daemons and tools like lvchange \
    echo 'sys-fs/lvm2 thin lvm' >> /etc/portage/package.use/lvm2 ;\
    # Ensure everything is up to date before we start \
    emerge-webrsync ;\
    emerge --quiet --update --deep --newuse --autounmask-continue=y --with-bdeps=y @world

# Dependencies to pass basic test
RUN \
emerge --quiet --deep --autounmask-continue=y --with-bdeps=n --noreplace \
    app-alternatives/bc \
    app-alternatives/cpio \
    app-arch/cpio \
    app-crypt/swtpm \
    app-crypt/tpm2-tools \
    app-emulation/qemu \
    app-misc/jq \
    app-portage/gentoolkit \
    dev-lang/perl \
    dev-lang/python \
    dev-lang/rust-bin \
    dev-libs/libfido2 \
    dev-libs/libxslt \
    dev-libs/openssl \
    dev-ruby/asciidoctor \
    net-dns/dnsmasq \
    net-fs/nfs-utils \
    net-misc/dhcp \
    net-wireless/bluez \
    sys-apps/nvme-cli \
    sys-block/nbd \
    sys-block/open-iscsi \
    sys-block/parted \
    sys-block/tgt \
    sys-boot/plymouth \
    sys-devel/bison \
    sys-devel/flex \
    sys-fs/btrfs-progs \
    sys-fs/cryptsetup \
    sys-fs/mdadm \
    sys-fs/multipath-tools \
    sys-fs/squashfs-tools \
    sys-fs/xfsprogs \
    sys-kernel/dracut \
    sys-kernel/gentoo-kernel-bin \
    sys-libs/libxcrypt \
    virtual/libelf \
    virtual/pkgconfig ;\
# Dependencies for systemd \
if [ "$OPTION" = "systemd" ] ; then \
    emerge --quiet --deep --autounmask-continue=y --with-bdeps=n --noreplace \
    sys-apps/systemd \
    sys-libs/glibc ;\
else \
    emerge --quiet --deep --autounmask-continue=y --with-bdeps=n --noreplace net-misc/networkmanager ;\
fi ;\
rm -rf /var/cache/* /usr/share/doc/* /usr/share/man/* ;\
emerge --depclean --with-bdeps=n