|
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 | | -## 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 |
8 | | -ENV LUET_NOLOCK=true |
9 | | - |
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/ / |
| 4 | +FROM quay.io/luet/base:$LUET_VERSION AS luet |
35 | 5 |
|
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 |
| 6 | +FROM registry.opensuse.org/opensuse/tumbleweed:latest AS default |
38 | 7 |
|
39 | | -# Versions of dependencies |
40 | | -# renovate: datasource=github-releases depName=tailscale/tailscale |
41 | | -ENV TAILSCALE_VERSION=1.40.0 |
| 8 | +# Copy the luet config file pointing to the upgrade repository |
| 9 | +COPY conf/luet.yaml /etc/luet/luet.yaml |
| 10 | +COPY --from=luet /usr/bin/luet /usr/bin/luet |
| 11 | +ENV LUET_NOLOCK=true |
42 | 12 |
|
43 | | -RUN apt-get update && apt-get autoclean && DEBIAN_FRONTEND=noninteractive apt-get install -y \ |
44 | | - tailscale=${TAILSCALE_VERSION} \ |
| 13 | +RUN zypper --non-interactive ar -g -r https://pkgs.tailscale.com/stable/opensuse/tumbleweed/tailscale.repo && \ |
| 14 | + zypper --non-interactive addrepo --refresh https://download.opensuse.org/repositories/system:/snappy/openSUSE_Tumbleweed snappy && \ |
| 15 | + zypper --gpg-auto-import-keys --non-interactive ref && zypper --non-interactive in -y \ |
| 16 | + aaa_base-extras \ |
| 17 | + bcm43xx-firmware \ |
| 18 | + conntrack-tools \ |
| 19 | + coreutils \ |
| 20 | + curl \ |
| 21 | + device-mapper \ |
| 22 | + dosfstools \ |
| 23 | + dracut \ |
| 24 | + dracut-extra \ |
| 25 | + dracut-kiwi-live \ |
| 26 | + e2fsprogs \ |
| 27 | + findutils \ |
| 28 | + gawk \ |
| 29 | + gptfdisk \ |
| 30 | + grub2 \ |
| 31 | + # grub2-efi automatically installs grub2-arm64-efi or grub2-i386pc depending on build platform |
| 32 | + grub2-efi \ |
| 33 | + haveged \ |
| 34 | + iproute2 \ |
| 35 | + iputils \ |
| 36 | + iw \ |
45 | 37 | jq \ |
| 38 | + kernel-default \ |
| 39 | + kernel-firmware-all \ |
| 40 | + kmod \ |
| 41 | + less \ |
| 42 | + libudev1 \ |
| 43 | + lsscsi \ |
| 44 | + lvm2 \ |
| 45 | + mdadm \ |
| 46 | + multipath-tools \ |
| 47 | + nano \ |
| 48 | + NetworkManager \ |
| 49 | + nfs-utils \ |
| 50 | + open-iscsi \ |
| 51 | + open-vm-tools \ |
| 52 | + parted \ |
| 53 | + python-azure-agent \ |
| 54 | + qemu-guest-agent \ |
| 55 | + raspberrypi-eeprom \ |
| 56 | + rng-tools \ |
| 57 | + rsync \ |
| 58 | + squashfs \ |
| 59 | + systemd \ |
| 60 | + systemd-sysvinit \ |
| 61 | + tar \ |
| 62 | + timezone \ |
| 63 | + vim \ |
| 64 | + vim-small \ |
| 65 | + which \ |
| 66 | + wireless-tools \ |
| 67 | + wpa_supplicant \ |
| 68 | + tailscale \ |
46 | 69 | qrencode \ |
47 | 70 | dmidecode \ |
48 | | - console-data \ |
49 | | - iscsiuio \ |
50 | 71 | snapd \ |
51 | 72 | openssh-server \ |
52 | 73 | sudo \ |
53 | | - netplan.io \ |
54 | | - iptables-persistent \ |
55 | 74 | net-tools \ |
56 | | - inetutils-ping \ |
57 | | - dnsutils \ |
58 | | - vim \ |
| 75 | + bind-utils \ |
59 | 76 | file \ |
60 | | - musl \ |
| 77 | + k9s \ |
61 | 78 | htop \ |
62 | | - tree |
63 | | - |
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 |
| 79 | + tree \ |
| 80 | + && luet install -y meta/cos-verify \ |
| 81 | + && luet install -y meta/cos-minimal \ |
| 82 | + && zypper cc \ |
| 83 | +# Configure NetworkManager as default network management service |
| 84 | + && zypper remove -y wicked \ |
| 85 | + && systemctl disable wicked \ |
| 86 | + && systemctl enable NetworkManager \ |
| 87 | +# finally, ensure initramfs is up to date |
| 88 | + && dracut -f --regenerate-all |
66 | 89 |
|
67 | 90 | COPY scripts/cloudinit /opt/microk8s/scripts |
68 | | - |
69 | 91 | RUN chmod +x /opt/microk8s/scripts/* |
70 | 92 |
|
71 | 93 | COPY overlay/files / |
72 | | - |
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 | | -RUN systemctl enable microk8s-tailscale-apiserver-ip.service |
87 | | -RUN systemctl enable tailscale-logind.service |
88 | | -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 | | - |
| 94 | +RUN systemctl enable microk8s-tailscale-apiserver-ip.service \ |
| 95 | + && systemctl enable tailscale-logind.service \ |
| 96 | + && systemctl enable tailscaled.service \ |
| 97 | + && systemctl enable getty@tty1 |
109 | 98 |
|
110 | 99 | ARG OS_NAME=edgenode OS_VERSION=latest OS_ID=edgenode BUG_REPORT_URL HOME_URL OS_REPO OS_LABEL GITHUB_REPO IMAGE_COMMIT |
111 | 100 | RUN envsubst > /etc/os-release < /usr/lib/os-release.tmpl |
| 101 | + |
0 commit comments