|
1 | | -# Binaries and files needed from elemental-toolkit repository |
2 | 1 | ARG LUET_VERSION=0.34.0 |
3 | 2 | ARG COS_VERSION=0.10.3 |
4 | 3 |
|
5 | 4 | ## Framework Build |
6 | | -FROM quay.io/luet/base:$LUET_VERSION AS framework-build |
7 | | -COPY framework/files/etc/luet/luet.yaml /etc/luet/luet.yaml |
| 5 | +FROM quay.io/luet/base:$LUET_VERSION AS luet |
| 6 | +# COPY framework/files/etc/luet/luet.yaml /etc/luet/luet.yaml |
8 | 7 | ENV LUET_NOLOCK=true |
9 | 8 |
|
10 | | -# Hack to get grub2 artifacts into the correct places |
11 | | -SHELL ["/usr/bin/luet", "install", "-y", "--system-target", "/grub-artifacts"] |
12 | | -RUN system/grub2-artifacts |
13 | | - |
14 | | -## Download K9S Tool |
15 | | -FROM alpine AS k9s-download |
16 | | -ARG TARGETARCH |
17 | | -ARG K9S_VERSION=latest |
18 | | -RUN apk add curl && \ |
19 | | - [ "$K9S_VERSION" = "latest" ] && VERSION=$(curl -s https://api.github.com/repos/derailed/k9s/releases/latest | grep "tag_name" | cut -d'"' -f4) || VERSION=$K9S_VERSION && \ |
20 | | - curl -sL https://github.com/derailed/k9s/releases/download/${VERSION}/k9s_Linux_${TARGETARCH}.tar.gz | tar -xz k9s -C /bin/ |
21 | | - # binary file will be available at /bin/k9s |
22 | | - |
23 | | -## Base OS Selection |
24 | | -FROM quay.io/costoolkit/releases-orange:cos-system-${COS_VERSION} AS base-os-amd64 |
25 | | -FROM quay.io/costoolkit/releases-orange-arm64:cos-system-${COS_VERSION} AS base-os-arm64 |
26 | | -## Base OS Build |
27 | | -FROM base-os-${TARGETARCH} AS default |
28 | | - |
29 | | -# grub2-artifacts hack |
30 | | -COPY --from=framework-build /grub-artifacts/ /usr/share/efi/ |
31 | | -COPY --from=framework-build /grub-artifacts/ /usr/share/grub2/ |
32 | | - |
33 | | -# Copy local framework files |
34 | | -COPY framework/files/ / |
35 | | - |
36 | | -RUN curl -fsSL https://pkgs.tailscale.com/stable/ubuntu/jammy.noarmor.gpg | tee /usr/share/keyrings/tailscale-archive-keyring.gpg >/dev/null && \ |
37 | | - curl -fsSL https://pkgs.tailscale.com/stable/ubuntu/jammy.tailscale-keyring.list | tee /etc/apt/sources.list.d/tailscale.list |
38 | | - |
39 | | -# Versions of dependencies |
40 | | -# renovate: datasource=github-releases depName=tailscale/tailscale |
41 | | -ENV TAILSCALE_VERSION=1.40.0 |
42 | | - |
43 | | -RUN apt-get update && apt-get autoclean && DEBIAN_FRONTEND=noninteractive apt-get install -y \ |
44 | | - tailscale=${TAILSCALE_VERSION} \ |
| 9 | +# SHELL ["/usr/bin/luet", "install", "-y", "--system-target", "/framework"] |
| 10 | +# RUN system/kernel |
| 11 | +# RUN system/dracut-initrd |
| 12 | +# RUN meta/cos-minimal |
| 13 | +# RUN meta/cos-verify |
| 14 | +# RUN toolchain/luet-mtree |
| 15 | +# RUN system/cos-features |
| 16 | + |
| 17 | +FROM registry.opensuse.org/opensuse/tumbleweed:latest AS default |
| 18 | + |
| 19 | +# COPY --from=framework-build /framework/ / |
| 20 | + |
| 21 | +# COPY framework/files/ / |
| 22 | + |
| 23 | +RUN zypper --non-interactive ar -g -r https://pkgs.tailscale.com/stable/opensuse/tumbleweed/tailscale.repo && \ |
| 24 | + zypper --non-interactive addrepo --refresh https://download.opensuse.org/repositories/system:/snappy/openSUSE_Tumbleweed snappy && \ |
| 25 | + zypper --gpg-auto-import-keys --non-interactive ref && zypper --non-interactive in -y \ |
| 26 | + aaa_base-extras \ |
| 27 | + bcm43xx-firmware \ |
| 28 | + conntrack-tools \ |
| 29 | + coreutils \ |
| 30 | + curl \ |
| 31 | + device-mapper \ |
| 32 | + dosfstools \ |
| 33 | + dracut \ |
| 34 | + e2fsprogs \ |
| 35 | + findutils \ |
| 36 | + gawk \ |
| 37 | + gptfdisk \ |
| 38 | + grub2 \ |
| 39 | + grub2-arm64-efi \ |
| 40 | + haveged \ |
| 41 | + iproute2 \ |
| 42 | + iputils \ |
| 43 | + iw \ |
45 | 44 | jq \ |
| 45 | + kernel-default \ |
| 46 | + kernel-firmware-all \ |
| 47 | + kmod \ |
| 48 | + less \ |
| 49 | + libudev1 \ |
| 50 | + lsscsi \ |
| 51 | + lvm2 \ |
| 52 | + mdadm \ |
| 53 | + multipath-tools \ |
| 54 | + nano \ |
| 55 | + NetworkManager \ |
| 56 | + nfs-utils \ |
| 57 | + open-iscsi \ |
| 58 | + open-vm-tools \ |
| 59 | + parted \ |
| 60 | + python-azure-agent \ |
| 61 | + qemu-guest-agent \ |
| 62 | + raspberrypi-eeprom \ |
| 63 | + rng-tools \ |
| 64 | + rsync \ |
| 65 | + squashfs \ |
| 66 | + systemd \ |
| 67 | + systemd-sysvinit \ |
| 68 | + tar \ |
| 69 | + timezone \ |
| 70 | + vim \ |
| 71 | + vim-small \ |
| 72 | + which \ |
| 73 | + wireless-tools \ |
| 74 | + wpa_supplicant \ |
| 75 | + tailscale \ |
46 | 76 | qrencode \ |
47 | 77 | dmidecode \ |
48 | | - console-data \ |
49 | | - iscsiuio \ |
50 | 78 | snapd \ |
51 | 79 | openssh-server \ |
52 | 80 | sudo \ |
53 | | - netplan.io \ |
54 | | - iptables-persistent \ |
55 | 81 | net-tools \ |
56 | | - inetutils-ping \ |
57 | | - dnsutils \ |
58 | | - vim \ |
| 82 | + bind-utils \ |
59 | 83 | file \ |
60 | | - musl \ |
| 84 | + k9s \ |
61 | 85 | htop \ |
62 | | - tree |
| 86 | + tree \ |
| 87 | + && zypper cc |
63 | 88 |
|
64 | | -# RUN snap download microk8s --channel=$MICROK8S_CHANNEL --target-directory /opt/microk8s/snaps --basename microk8s |
65 | | -# RUN snap download core --target-directory /opt/microk8s/snaps --basename core |
| 89 | +# Configure NetworkManager as default network management service |
| 90 | +RUN zypper remove -y wicked |
| 91 | +RUN systemctl disable wicked \ |
| 92 | + && systemctl enable NetworkManager |
66 | 93 |
|
67 | | -COPY scripts/cloudinit /opt/microk8s/scripts |
| 94 | +# Copy the luet config file pointing to the upgrade repository |
| 95 | +COPY conf/luet.yaml /etc/luet/luet.yaml |
| 96 | +COPY --from=luet /usr/bin/luet /usr/bin/luet |
| 97 | +RUN luet install -y meta/cos-verify |
| 98 | +RUN luet install -y meta/cos-minimal |
| 99 | +RUN luet install -y system/dracut-initrd |
68 | 100 |
|
| 101 | +COPY scripts/cloudinit /opt/microk8s/scripts |
69 | 102 | RUN chmod +x /opt/microk8s/scripts/* |
70 | 103 |
|
71 | 104 | COPY overlay/files / |
72 | 105 |
|
73 | | -RUN setupcon --save |
74 | | - |
75 | | -COPY --from=k9s-download /bin/k9s /usr/bin/k9s |
76 | | - |
77 | | -# RUN apt install -y linux-image-generic initramfs-tools |
78 | | - |
79 | | -## Workarounds for elemental installer looking for shim files (https://github.com/rancher/elemental-cli/blob/19a9832efe6cc5411f76f97204543700a7d45ea6/pkg/utils/grub.go#LL196C63-L196C81) |
80 | | -RUN apt install -y grub-efi shim shim-signed |
81 | | - |
82 | | -RUN ln -s /usr/bin/grub-editenv /usr/bin/grub2-editenv |
83 | | -RUN systemctl enable systemd-networkd |
84 | | -RUN systemctl enable ssh |
85 | | -RUN systemctl disable set-hostname.service |
86 | 106 | RUN systemctl enable microk8s-tailscale-apiserver-ip.service |
87 | 107 | RUN systemctl enable tailscale-logind.service |
88 | 108 | RUN systemctl enable tailscaled.service |
89 | | - |
90 | | -# Enable tmp |
91 | | -RUN cp -v /usr/share/systemd/tmp.mount /etc/systemd/system/ |
92 | | -RUN systemctl enable tmp.mount |
93 | | - |
94 | | -# Fixup sudo perms |
95 | | -RUN chown root:root /usr/bin/sudo && chmod 4755 /usr/bin/sudo |
96 | | - |
97 | | - |
98 | | -# Clear cache |
99 | | -RUN rm -rf /var/cache/* && journalctl --vacuum-size=1K && (rm /etc/machine-id || true) && (rm /var/lib/dbus/machine-id || true) && (rm /etc/hostname || true) |
100 | | -# Remove SSH Host keys generated from installing the openssh-server |
101 | | -RUN rm -rf /etc/ssh/ssh_host_* |
102 | | - |
103 | | -# # Rebuild initrd to setup dracut with the boot configurations |
104 | | -RUN kernel=$(readlink -f /boot/vmlinuz) && \ |
105 | | - version=${kernel##/boot/vmlinuz-} && \ |
106 | | - mkinitrd /boot/initrd-${version} ${version} && \ |
107 | | - cd /boot && ln -sf initrd-${version} initrd |
108 | | - |
| 109 | +RUN systemctl enable getty@tty1 |
109 | 110 |
|
110 | 111 | ARG OS_NAME=edgenode OS_VERSION=latest OS_ID=edgenode BUG_REPORT_URL HOME_URL OS_REPO OS_LABEL GITHUB_REPO IMAGE_COMMIT |
111 | 112 | RUN envsubst > /etc/os-release < /usr/lib/os-release.tmpl |
| 113 | + |
| 114 | +RUN dracut -f --regenerate-all |
| 115 | +RUN ln -sf Image /boot/vmlinuz |
0 commit comments