Skip to content

Commit

Permalink
sles base image dockerfile (#106)
Browse files Browse the repository at this point in the history
  • Loading branch information
santhoshdaivajna authored Dec 17, 2023
1 parent d126126 commit 515b83d
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ do so (now or later) by using -c with the switch command. Example:
```shell
cp .arg.template .arg
```
6. To build RHEL core, RHEL FIPS or Ubuntu fips base images switch to respective directories and build the base image.
6. To build RHEL core, RHEL FIPS or Ubuntu fips, sles base images switch to respective directories and build the base image.
The base image built can be passed as argument to build the installer and provider images.
Follow the instructions in the respective sub-folders (rhel-fips, ubuntu-fips) to create base images.
For ubuntu-fips, this image can be used as base image - `gcr.io/spectro-images-public/ubuntu-focal-fips:v4.0_20230817`
Expand Down
44 changes: 44 additions & 0 deletions slem/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
ARG BASE_IMAGE=registry.suse.com/suse/sle-micro-rancher/5.4:latest
FROM $BASE_IMAGE
ADD repos/SUSE* /etc/zypp/repos.d/
ADD services/* /etc/zypp/services.d/
RUN zypper --gpg-auto-import-keys ref
RUN zypper in --force-resolution -y \
cryptsetup \
nfs-client \
kernel-firmware-all \
systemd-network \
polkit \
rng-tools \
nano \
&& zypper cc
ADD repos/opensuse* /etc/zypp/repos.d/
RUN zypper --gpg-auto-import-keys ref
RUN zypper in --force-resolution -y --no-allow-vendor-change \
htop \
fail2ban \
lldpd \
nethogs \
&& zypper cc
# NOTE: removed dhcp-client
RUN mkdir -p /run/lock
RUN mkdir -p /usr/libexec
RUN touch /usr/libexec/.keep
COPY --from=quay.io/kairos/framework:v2.4.3_opensuse-leap / /
# Activate Kairos services
RUN systemctl enable cos-setup-reconcile.timer && \
systemctl enable cos-setup-fs.service && \
systemctl enable cos-setup-boot.service && \
systemctl enable cos-setup-network.service
# Remove /etc/dracut.conf.d/90-kairos-network-legacy.conf to allow dracut to build initrd without dhcp-client
RUN rm -f /etc/dracut.conf.d/90-kairos-network-legacy.conf
## Generate initrd
RUN kernel=$(ls /boot/vmlinuz-* | head -n1) && \
ln -sf "${kernel#/boot/}" /boot/vmlinuz
RUN kernel=$(ls /lib/modules | head -n1) && \
dracut -v -N -f "/boot/initrd-${kernel}" "${kernel}" && \
ln -sf "initrd-${kernel}" /boot/initrd && depmod -a "${kernel}"
RUN kernel=$(ls /lib/modules | head -n1) && dracut -f "/boot/initrd-${kernel}" "${kernel}" && ln -sf "initrd-${kernel}" /boot/initrd
RUN rm -rf /boot/initramfs-*
RUN rm -rf /etc/zypp/repos.d/*
RUN rm -rf /etc/zypp/services.d/*

0 comments on commit 515b83d

Please sign in to comment.