1
0
mirror of https://github.com/rancher/os.git synced 2025-08-18 14:58:32 +00:00
os/Dockerfile

133 lines
3.2 KiB
Docker
Raw Normal View History

2021-08-31 18:14:03 +00:00
FROM opensuse/leap:15.3 AS build
RUN zypper in -y squashfs xorriso go1.16 upx busybox-static
COPY go.mod go.sum /usr/src/
COPY cmd /usr/src/cmd
COPY pkg /usr/src/pkg
RUN cd /usr/src && \
CGO_ENABLED=0 go build -ldflags "-extldflags -static -s" -o /usr/sbin/ros-installer ./cmd/ros-installer && \
upx /usr/sbin/ros-installer
2021-08-31 18:14:03 +00:00
FROM scratch AS framework
COPY --from=build /usr/bin/busybox-static /usr/bin/busybox
COPY --from=quay.io/luet/base:0.17.8 /usr/bin/luet /usr/bin/luet
COPY framework/files/etc/luet/luet.yaml /etc/luet/luet.yaml
COPY --from=build /etc/ssl/certs /etc/ssl/certs
2021-08-31 18:14:03 +00:00
ARG CACHEBUST
ENV LUET_NOLOCK=true
2021-08-31 18:14:03 +00:00
RUN ["luet", \
"install", "--no-spinner", "-d", "-y", \
"selinux/k3s", \
"selinux/rancher", \
"system/base-dracut-modules", \
"system/cloud-config", \
"system/cos-setup", \
"system/grub2-config", \
"system/immutable-rootfs", \
"toolchain/yip", \
"utils/installer", \
"utils/k9s", \
2021-10-03 06:14:04 +00:00
"utils/rancherd", \
2021-08-31 18:14:03 +00:00
"utils/nerdctl"]
2021-06-25 18:01:35 +00:00
2021-08-31 18:14:03 +00:00
COPY --from=build /usr/sbin/ros-installer /usr/sbin/ros-installer
COPY framework/files/ /
RUN ["/usr/bin/busybox", "rm", "-rf", "/var", "/etc/ssl", "/usr/bin/busybox"]
# Make OS image
FROM opensuse/leap:15.3 as os
2021-06-06 00:31:50 +00:00
RUN zypper in -y \
2021-10-03 05:27:31 +00:00
apparmor-parser \
2021-08-31 18:14:03 +00:00
avahi \
2021-06-06 00:31:50 +00:00
bash-completion \
conntrack-tools \
coreutils \
curl \
device-mapper \
2021-10-03 05:27:31 +00:00
dmidecode \
2021-06-06 00:31:50 +00:00
dosfstools \
dracut \
e2fsprogs \
2021-10-03 05:27:31 +00:00
ethtool \
2021-06-06 00:31:50 +00:00
findutils \
gawk \
2021-06-25 18:01:35 +00:00
gptfdisk \
2021-06-06 00:31:50 +00:00
grub2-i386-pc \
grub2-x86_64-efi \
haveged \
2021-10-03 05:27:31 +00:00
hdparm \
iotop \
2021-06-06 00:31:50 +00:00
iproute2 \
iptables \
2021-06-18 23:48:33 +00:00
iputils \
2021-06-25 18:01:35 +00:00
issue-generator \
2021-06-06 00:31:50 +00:00
jq \
kernel-default \
kernel-firmware-bnx2 \
2021-10-03 05:27:31 +00:00
kernel-firmware-chelsio \
2021-06-06 00:31:50 +00:00
kernel-firmware-i915 \
kernel-firmware-intel \
kernel-firmware-iwlwifi \
2021-10-03 05:27:31 +00:00
kernel-firmware-liquidio \
kernel-firmware-marvell \
kernel-firmware-mediatek \
2021-06-06 00:31:50 +00:00
kernel-firmware-mellanox \
kernel-firmware-network \
kernel-firmware-platform \
2021-10-03 05:27:31 +00:00
kernel-firmware-qlogic \
2021-06-06 00:31:50 +00:00
kernel-firmware-realtek \
2021-10-03 05:27:31 +00:00
kernel-firmware-usb-network \
2021-06-06 00:31:50 +00:00
less \
2021-10-03 05:27:31 +00:00
lshw \
lsof \
2021-06-06 00:31:50 +00:00
lsscsi \
lvm2 \
mdadm \
multipath-tools \
nano \
2021-08-31 18:14:03 +00:00
netcat-openbsd \
2021-06-06 00:31:50 +00:00
nfs-utils \
open-iscsi \
open-vm-tools \
parted \
2021-10-03 05:27:31 +00:00
pciutils \
2021-06-25 18:01:35 +00:00
pigz \
policycoreutils \
procps \
2021-10-03 05:27:31 +00:00
psmisc \
2021-06-06 00:31:50 +00:00
python-azure-agent \
qemu-guest-agent \
2021-10-03 05:27:31 +00:00
rng-tools \
2021-06-06 00:31:50 +00:00
rsync \
squashfs \
strace \
2021-08-31 18:14:03 +00:00
SUSEConnect \
2021-10-03 05:27:31 +00:00
sysstat \
2021-06-06 00:31:50 +00:00
systemd \
systemd-sysvinit \
tar \
2021-10-03 05:27:31 +00:00
tcpdump \
2021-06-06 00:31:50 +00:00
timezone \
vim \
2021-10-03 05:27:31 +00:00
which \
zstd
2021-06-06 00:31:50 +00:00
2021-08-31 18:14:03 +00:00
# Copy in some local OS customizations
COPY opensuse/files /
2021-06-06 00:31:50 +00:00
2021-08-31 18:14:03 +00:00
# Starting from here are the lines needed for RancherOS to work
# IMPORTANT: Setup rancheros-release used for versioning/upgrade. The
2021-10-03 05:27:31 +00:00
# values here should reflect the tag of the image being built
2021-08-31 18:14:03 +00:00
ARG IMAGE_REPO=norepo
ARG IMAGE_TAG=latest
RUN echo "IMAGE_REPO=${IMAGE_REPO}" > /usr/lib/rancheros-release && \
echo "IMAGE_TAG=${IMAGE_TAG}" >> /usr/lib/rancheros-release && \
echo "IMAGE=${IMAGE_REPO}:${IMAGE_TAG}" >> /usr/lib/rancheros-release
2021-06-06 00:31:50 +00:00
2021-08-31 18:14:03 +00:00
# Copy in framework runtime
COPY --from=framework / /
# Rebuild initrd to setup dracut with the boot configurations
RUN mkinitrd